5 February 2014

Nexus - SSH Error

Working on a Nexus 5548 last week I came across the following error when trying to SSH to another switch from here.
CORE-01# ssh admin@10.113.150.252
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
70:81:d5:1e:64:51:e5:ba:2d:9a:55:8d:fa:43:59:b8.
Please contact your system administrator.
Add correct host key in /var/home/admin/.ssh/known_hosts to get rid of this message.
Offending key in /var/home/admin/.ssh/known_hosts:8
RSA host key for 10.1.150.252 has changed and you have requested strict checking.
Host key verification failed.
Solution is pretty easy...
CORE-01# clear ssh hostsCORE-01# ssh admin@10.1.150.252
The authenticity of host '10.1.150.252 (10.113.150.252)' can't be established.
RSA key fingerprint is 70:81:d5:1e:64:51:e5:ba:2d:9a:55:8d:fa:43:59:b8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.1.150.252' (RSA) to the list of known hosts.
admin@10.1.150.252's password:
Type help or '?' for a list of available commands.
EDGE-01> en
Password: *********
This happens when the Nexus switch has a pre-existing SSH key stored for the remote device and the remote device's key changes. The command simply clears the buffer of local SSH keys stored for remote hosts. I've seen this on Linux servers before as well.

Hope it helps. Thanks for reading.