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_hosts to get rid of this message. Offending key in /root/.ssh/known_hosts:7 RSA 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?

migrated from stackoverflow.com Sep 21 '11 at 16:27

This question came from our site for professional and enthusiast programmers.

  • This is a serverfault.com question, but: It seems like server 2's SSH certificate has changed since the last time you tried to access it, so your client is raising alarms because the certificate's different from the one that it knows about. – wkl Sep 21 '11 at 15:39
  • How come I am able to ssh port fwd into server2's app port? It makes me think that ssh port fwd & direct ssh access to box are 2 independent accesses? – Sunshine Sep 21 '11 at 15:44
  • 1
    In the tunneling scenario, you establish an SSH connection to server 1, which then forwards the port 9999 from server 2 via a secure connection. No SSH connection is made to server 2 from server 1 in this situation. Meanwhile, when you do ssh server2 from your own machine, your client looks in ~/.ssh/known_hosts for 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 your known_hosts file has a different key. – wkl Sep 21 '11 at 15:51
  • Yes, I get it. Thanx.. – Sunshine Sep 21 '11 at 16:22

Your Answer

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

Browse other questions tagged or ask your own question.