Wednesday, April 28, 2010

Avoid warning when access remote server via ssh with multiple accounts on one client.

AT.
If you put all the public key of local client on the server, and then you connect it via ssh, it will promote a warning.
Warning: the RSA host key for 'a.b.com' differs from the key for the IP address 'x.x.x.x'.

This happened because the ssh server check the key according to the IP address, and since we have multiple account on local client,The server will recored different RSA key from a unique IP,It will result in conflict.

It could be solved by setting the option,
check out ssh_option(5)
e.g sudo -u super_a ssh -o checkhostip="no" username@remote_host 'echo "hi"'.

No comments: