Renew the RSA Host Key


I’m used to log into one of my servers systems leveraging ssh. More often than not it happens to me that I re-deployed one of my servers or I’m using the same IP address for the system (I restricted my DHCP server to only a small IP address range). For that reason the same IP addresses might have been used for different systems.

Long story short, my Mac anticipates a fraud, when I’m trying to use ssh to log into a particular server.

Open a Terminal session and write the command vi /Users/yourname/.ssh/known_hosts

Vi ssh

Scroll down (j-key) to the ssh-key you want to delete and hit the d-key two times to delete the line. Exit vi and save the file with esc-key and the command :wq!.If you need additional help on how to navigate with vi, please check here.

Now, log in to your server as usual ssh -l username ip-address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s