Updating knownhosts

Rated 4.82/5 based on 976 customer reviews

I'd really like to avoid having to use Expect or whatever to answer the interactive prompt if I can.

@Mnebuerquo: If you were worried about security then you wouldn't have anything at all to do with this question.

Lines are expected to not have leading or trailing whitespace.

We don’t bother to check for comments or empty lines.

Parses the given line of text to find the names for the host, the type of key, and the key data.

The line is expected to be in the format used by the Open SSH known_hosts file.

One of the more irritating things about working with virtual machines is SSH host keys. Of course, if you don't care about security you could arrange for all your virtual machines to use the same host key, or use the option; but as the Free BSD Security Officer and the author of a secure online backup service neither of those are acceptable as far as I'm concerned.

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 REMOVED FOR SECURITY REASONS Please contact your system administrator.

Find the host key fingerprint in the virtual machine's console logs. Type "yes" and hope that they really were the same and not just mostly the same.

Get a pesky warning message telling you that the authenticity of the host can't be established.

Leave a Reply