reyesjmf
By:
reyesjmf

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED

April 25, 2017 1.1k views
Getting Started Security

Hello! I am a complete novice so please bear with me.

I had a droplet running Debian that was working fine. I decided to rebuild it to Ubuntu just to try it out and basically get my feet wet in running more SSH commands.

Now, whenever I log in via SSH (using Chrome's Secure Shell) i get: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED error.

I did a quick search and learned that i can run ssh-keygen -R "you server hostname or ip" to fix the problem. I then opened the console from inside my Digital Ocean account and ran the line. However, all i get is do_known_hosts: hostkeys_foreach failed: No such file or directory

If it matters, I also reset my root password and received the new one via email. Logged in via DO Console and was asked to enter a new one which I did. Also FYI, the error only appears when I log in using Chrome's Secure Shell and not on DO's Console.

Anyone?

2 comments
  • Hello,

    I haven't got any experience with Secure Shell in Chrome, but because you rebuild the machine the key hosts file changed. Basically you gave the machine a new ID.
    Try to use an SSH client like PuTTY and see if you can get further with the connection.

  • Hi, thanks for the reply.

    I tried to use PuTTy. Entered the hostname and hit "Open".
    It asked for "login as:", I entered "root" and got a fatal error popup saying:

    Disconnected: No supported authentication methods available (server send: publickey)

2 Answers

Hi @reyesjmf

Are you using SSH keys to access the server? Or did you setup the server originally with keys?
And let's stay with PuTTY, until you can access with that, then we can look at CSS.

  • CSS? You meant SSH?

    Note that if you have a console and SSH, it's much easier than PuTTY that does not generate compatible keys by default.

    • @AlexisWilke
      Correct, SSH. Typo.
      If PuTTY is being used, then the person is using Windows and doesn't have console nor ssh-client by default.
      But this question thread is two weeks old.

You are expected to run ssh-keygen -R "you server hostname or ip" on your client (so in Chrome's Secure Shell) and not on the server.

Have another answer? Share your knowledge.