Impossible to connect ssh /root/.ssh/known_hosts': No such file or directory

8,690

The known_hosts file resides on the client.

Are you sure you know what you are doing?

Share:
8,690

Related videos on Youtube

mpgn
Author by

mpgn

Updated on September 18, 2022

Comments

  • mpgn
    mpgn over 1 year

    I can't connect to my server with ssh. I have already started a session with ssh but i know if i quit this session, i won't be able to connect again to my server.

    ssh [email protected]
    
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    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
    07:fe:8f:12:83:09:ce:87:ec:60:9d:75:b4:d2:04:12.
    Please contact your system administrator.
    Add correct host key in /root/.ssh/known_hosts to get rid of this message.
    Offending ECDSA key in /root/.ssh/known_hosts:3
    Password authentication is disabled to avoid man-in-the-middle attacks.
    Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
    Permission denied (publickey,password).
    
    ssh -o StrictHostKeyChecking=no [email protected]
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    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
    07:fe:8f:12:83:09:ce:87:ec:60:9d:75:b4:d2:04:12.
    Please contact your system administrator.
    Add correct host key in /root/.ssh/known_hosts to get rid of this message.
    Offending ECDSA key in /root/.ssh/known_hosts:3
    Password authentication is disabled to avoid man-in-the-middle attacks.
    Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
    Permission denied (publickey,password).
    

    I try :

    rm /root/.ssh/known_hosts
    rm: cannot remove `/root/.ssh/known_hosts': No such file or directory
    
    ssh-keygen -R genese.com
    ssh-keygen: /root/.ssh/known_hosts: No such file or directory
    
  • mpgn
    mpgn over 10 years
    tell me more if you except an answer ...
  • Kishan K
    Kishan K over 10 years
    The offending host key is located on the client. The host key is used to make sure you talk to the server you are supposed to talk to. You probably reinstalled your server, right? Well, you still have the old host key on the client. You have to correct the known_hosts file on the client, meaning delete the offending line, if really you believe it has changed on the server (otherwise you have a problem).
  • mpgn
    mpgn over 10 years
    Yes i reinstalled my server, but i really don't understand what do you mean by : "on the client". As you can see, the file known_hosts doesn't exist.
  • Kishan K
    Kishan K over 10 years
    It doesn't exist on the server. It certainly exists on the client you are trying to connect from ("Offending ECDSA key in /root/.ssh/known_hosts:3")
  • mpgn
    mpgn over 10 years
    so simple ! thx, i'm really retarded, thx for the explanation and your time.