0

From my mac, I can ssh to an ubuntu machine without a problem.

The key is under my ~/.ssh/known_hosts.

When I try to sshfs to the same ip i get:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ECDSA key sent by the remote host is
SHA256:klJ1Y+1p8LdZuhukPrdpIOlolC05sX628n9owaM4DZY.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /var/root/.ssh/known_hosts:4
ECDSA host key for xx.xx.xx.xx has changed and you have requested strict checking.
Host key verification failed.
remote host has disconnected

The key mentioned on the log is not the one I have on known_hosts for this IP, is that right?

1 Answer 1

3

You're mounting sshfs from root or using sudo, while ssh is called with your normal user.

So sshfs Host key is not in ~/.ssh/known_hosts, but /var/root/.ssh/known_hosts.

Remove line 4 of that file and it will work:

sudo sed -i '4d' /var/root/.ssh/known_hosts

Alternatively, run sshfs with your normal user without sudo.

2
  • 1
    I ran into a similar issue, except that the symptom was "remote host has disconnected". Running sshfs from the client without sudo fixed it.
    – merlinND
    Commented Oct 2, 2020 at 9:03
  • I just spent like 30 minutes trying to solve that 'remote host has disconnected.' Only to find your comment and realize that because I was using sudo it wasn't using the right account for paths and permissions. Thanks for solving my problem pLumo. Commented Dec 30, 2023 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .