0

I’m a non-sudo user trying to ssh into another server. When I do, it complains that the host key and IP address for the host has changed according to the known_hosts file (and indeed it has). Unfortunately, I can’t change the known_hosts file, and using the -o StrictHostKeyChecking=no option disables password authentication.

0

I can’t change the known_hosts file

If you can copy it, so you can change the copy, then tell ssh to use the copy. The relevant options in ssh_config are:

GlobalKnownHostsFile
Specifies one or more files to use for the global host key database, separated by whitespace. The default is /etc/ssh/ssh_known_hosts, /etc/ssh/ssh_known_hosts2.

UserKnownHostsFile
Specifies one or more files to use for the user host key database, separated by whitespace. The default is ~/.ssh/known_hosts, ~/.ssh/known_hosts2.

(source)

But wait! You said

using the -o StrictHostKeyChecking=no option disables password authentication.

I think it's not the option that disables password authentication. It's the new server who doesn't allow it. This means any approach that lets you actually connect to this particular server will not work along with password authentication. It doesn't matter if you circumvent the obsolete known_hosts file or get it fixed; the server itself is configured not to allow passwords.

If you're sure it's the right server then ask the server admin to allow passwords (or maybe they will provide some other way of authentication). Ask your local admin to update the known_hosts file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.