There are 2 servers - server1, server2. To access app port on server2, I go via port forwarding.
ssh myuser@server1 -L 7777:server2:9999
So, now I simply direct my browser & point it to 7777 and it connects me to my app port on server2.
But when I do a ssh to server2 directly, then it fails.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! 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
33:0d:01:d3:09:33:55:91:eb:19:90:70:51:cb:cd:c2. Please contact your system administrator. Add correct host key in/root/.ssh/known_hoststo get rid of this message. Offending key in/root/.ssh/known_hosts:7RSA host key for server2 has changed and you have requested strict checking. Host key verification failed.
From the error, it appears that my key is not present in the authorized key list at the server [ correct? ]. But then I am able to do port forward to app port on server2.
How can I do this?
ssh server2from your own machine, your client looks in~/.ssh/known_hostsfor the key signature that it gets from the remote server, and determines if they match (or if it even exists). In your case, it got a key for server 2, but yourknown_hostsfile has a different key. – birryree Sep 21 '11 at 15:51