Delete host key from known_hosts file

I normally delete the known_hosts file on my machine (not server) when I ssh to a server because the fingerprint has changed. You can delete host’s key as follows.

ssh-keygen -R hostname
# Host hostname found: line 6
/Users/benjaminr/.ssh/known_hosts updated.
Original contents retained as /Users/benjaminr/.ssh/known_hosts.old

Of course, you don’t want to simply do this unless you are aware something changed.

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s