SSH and SFTP Connection Errors

Have issues connecting via SSH or SFTP? If you’re getting an error like the one below, this usually happens because the IP address or the SSH key fingerprint has changed (often due to a server update), and the old one is still stored in your known_hosts file. The known_hosts is used for SSH and SFTP connections.

[user@hostname ~]$ ssh root@user
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
xx:xx:xx.
Please contact your system administrator.
Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/lib/sss/pubconf/known_hosts:4
RSA host key for user has changed and you have requested strict checking.
Host key verification failed.

Can’t connect via SSH or SFTP – Delete SSH known_hosts

If you’re having trouble connecting, first ensure you are using the correct password. You can always change your SFTP and or SSH password from within MyKinsta.

If the issue persists, follow the directions below to delete entries from your known_hosts file.

Mac or Linux

  1. Open up Terminal and edit your known_hosts file in nano text editor with the following command:
nano ~/.ssh/known_hosts
  1. Remove all entries that start with your site’s Host IP address (found in the SFTP/SSH section on your site’s Info tab in MyKinsta). You can delete each line that you need to remove with Ctrl+k.
  2. Then save the document (Ctrl+x). When prompted, answer Y for yes and do not change the file name (just hit return when prompted for the file name to confirm and keep the current name).

Windows

If you are on Windows, it also has a similar known_hosts file, but the credentials and IP are stored in the registry.

  1. Launch regedit from your start menu. The example below is using Windows 10.
    regedit
    Windows regedit
  2. Browse to the following directory:
    HKEY_CURRENT_USERSoftWareSimonTathamPuTTYSshHostKeys
    sshhostkeys
    SshHostKeys
  3. Remove all entries that end with your site’s Host IP address (found in the SFTP/SSH section on your site’s Info tab in MyKinsta).
Was this article helpful?