MyWiseGuys

Deleting Known_Hosts file for .ssh authentication errors

When accessing an endpoint via .ssh from a Mac for the first time, there is an authentication that occurs which matches a key on the remote host to a directory entry on your machine.  If there is no entry already in place on your machine, you will simply be prompted to approve the connection by entering ‘yes’ at the prompt.  However, if you already have a key in your  /users/<username>/.ssh/Known_Hosts  file, you can be prompted with a much more sinister message:

This requires a more aggressive approach.  You will need to delete the key from your directory by doing the following:

From your Terminal window: You should have a prompt that ends with a $ sign.

1. $open /Users/username/.ssh/known_hosts

2. This will open a text editor that displays all of your keys.  It will be formatted as first an IP address followed by the keys associated with that address.

3. Delete all the keys immediately following that IP address

Leave a reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.