1
I installed an Ubuntu server image on VirtualBox. Next I configured port forwarding 2222=>22.
When I use the following command things work ok :
ssh -p 2222 java@127.0.0.1
Password is prompted and I can login into Ubuntu on VBox.
However when I use :
ssh -p 2222 java@localhost
i get the following
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 a host key has just been changed. The fingerprint for the RSA key sent by the remote host is ......... Please contact your system administrator. Add correct host key in /Users/cristian/.ssh/known_hosts to get rid of this message. Offending RSA key in /Users/cristian/.ssh/known_hosts:2 RSA host key for [localhost]:2222 has changed and you have requested strict checking. Host key verification failed.
Of course
ping localhost PING localhost (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.038 ms
Any idea why ?
Thanks
did the host key change? did the host get re-installed? – Skaperen – 2015-02-14T13:03:37.870
no the only difference is once i call it with 127.0.0.1 and second time with localhost – Cris – 2015-02-14T13:07:00.067
some other host must have previously been accessed as localhost – Skaperen – 2015-02-14T13:10:10.427
what do you mean ? – Cris – 2015-02-14T13:11:23.010
ssh does not differentiate hosts by port number ... is 2222 a tunnel to some other host? – Skaperen – 2015-02-14T13:12:39.993
ssh remembers the remote host key by hostname and IP. after the first time it checks to be sure the host key is the same. this time the key did not match – Skaperen – 2015-02-14T13:15:57.840
port forwarding configured via box : host 2222 ==> vbox 22 – Cris – 2015-02-14T13:20:18.140