By reyesjmf
I created a new droplet and set it to use the usual SSH key on my account that I generated a long time ago with PuttyGen on Windows. I’m on a Mac now so I just copied over the PPK file thinking that I could use it to login. Turns out I can’t. I tried changing the permission of the file using chmod 600 but that didnt work. I went back to my Windows machine and used PuttyGen to convert the .ppk to an open ssh one. Same filename but with a .pem extension. I still can’t login to my server. Im geetting this:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 [a long string of letters and numbers]
Please contact your system administrator.
Add correct host key in /Users/me/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/me/.ssh/known_hosts:1
ECDSA host key for IPADDRESS has changed and you have requested strict checking.
Host key verification failed.
Anybody?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi there @reyesjmf,
You could try using the ssh-keygen
command to delete the invalid key from your known_hosts
file. The command that you need to use would be:
- ssh-keygen -R "you server hostname or ip"
Let me know how it goes! Regards, Bobby
@bobbyiliev It worked like a charm! I ran your command and tried to connect with:
$ ssh -i myKey.pem root@IPADDRESS
I got an error that my file wasn’t accessible and got “Warning: Permanently added ‘IPADDRESS’ (ECDSA) to the list of known hosts. Permission denied”
I tried again by adding the file path this way:
$ ssh -i ~/.ssh/myKey.pem root@IPADRESS
This time I was able to login.
Thanks for the help!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.