mobile-shell / mosh

Mobile Shell
https://mosh.org
GNU General Public License v3.0
12.47k stars 727 forks source link

Can not connect (MacOS Terminal.app 12.4 -> Ubuntu 22.04 server) #1211

Closed bora89 closed 1 year ago

bora89 commented 2 years ago

Hi guys, I can not figure out what is wrong, I have installed mosh on both client and server sides, but I get a message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
SHA256:ztClBuvaUKCjDzkHBQTAV9sRvseJhs5OJD5t9QwT6tg.
Please contact your system administrator.
Add correct host key in /Users/bora89/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/bora89/.ssh/known_hosts:2
Host key for MYSERVER.COM has changed and you have requested strict checking.
Host key verification failed.
/opt/homebrew/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

I do not have this kind of warning if I log in with SSH, although I tried to update known hosts with ssh-keygen -R MYIPADDR

I also search all issues and did not find similar to my. Any help would be great

Here is mosh version on my Macbook:

bora89@Alexanders-MacBook-Pro ~ % mosh -v
mosh 1.3.2 [build mosh 1.3.2]
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
pcho commented 1 year ago

@bora89 You need to remove or edit that host from in known_hosts file

eminence commented 1 year ago

I agree with @pcho that this does not look like a mosh issue -- the ssh server has a new host key, and you have strict key checking enabled. So fixup your known_hosts file (line 2), and you should be all set.