Can’t SSH into server: Host key verification failed

If you ever see this error, is likely because your server was rebuilt.

When a server gets rebuilt, the SSH host key changes, and when you try to connect, SSH will try to match the cached host key to the server’s host key, but they will not match, causing an error.

If your server was in fact rebuilt, there’s nothing to worry about — but if it wasn’t, contact us immediately.

To get past this error, open the ~/.ssh/known_hosts file in your local computer. There should be a line that starts with the domain name or IP address that you’re trying to connect (the error also says which line is it, it’s the number after the colon, like known_hosts:39).

Delete that line and save the file with a text editor, and the error will disappear the next time you connect to the server through SSH.