This guide describes how to remove warnings that may appear when trying to connect to your domain/web server through SSH. The warning referred to in this guide is the "host key mismatch". It should look similar to the following:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:x
RSA host key for ras.mydomain.com has changed and you have requested strict checking.
Host key verification failed.
If you have connected to a host in the past and the key has been updated on the server, you must now remove the old key from your device and generate a new one. Below we explain how to do this.
IMPORTANT: Please note that the modification to fix this must be performed on the SSH client side. Therefore, if you access this connection from home/work, you must update that specific device.
Update SSH keys on Windows
To update keys on Windows devices, it must be done through the PuTTY tool.
To do this, we must download the tool to our device. You can search for it directly on Google:
When accessing the first link, go to the "Download PuTTY" section and click on "here" to view the different versions of the program.
From this list, download the file that matches your device specifications. In our case, we are using a 64-bit Windows system, so we download the first option.
Wait until the file finishes downloading to your device.
Once downloaded, run the file. You will need to allow it to run with administrator permissions. After doing so, the following window will appear and you must click "Next":
Next, select the installation path and click "Next":
Select the features you want to install and click "Install":
The program will now be installed.
Finally, a text file with the README and the application usage terms will open.
Once installed, run the program on your device. The interface will look like the following:
In the hostname field you must enter the name of your hosting or the IP of your server. You can obtain this information from the SSH section of the control panel. After entering it, click "Open" to start the connection.
A new window will appear like the following, indicating that the SSH key is not compatible.
It is also possible that the PuTTY terminal will appear directly, but when attempting to connect you will see the error shown at the beginning.
To change the keys on your device, search in your system (using the Windows button) for the file regedit.exe. It should appear like this:
Accept with administrator permissions so the system can run the file, and then the different folders will appear:
Once inside, go to the path HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys
When accessing it, the assigned keys will appear. You must delete the one that does not have a defined value by right-clicking and selecting delete.
Afterwards, if you run PuTTY again, it should now allow you to access the server correctly:
Update SSH keys on MAC / Linux
To update keys on MAC or Linux, you must run the following command in the terminal:
ssh-keygen -R HOSTNAME
You must replace HOSTNAME with the host you are trying to connect to.
If you prefer, you can do it directly with the IP address:
ssh-keygen -R IP
After running one of the two commands, you will receive something like:
# Host HOSTNAME found: line #
/home/user/.ssh/known_hosts updated.
Original contents retained as /home/user/.ssh/known_hosts.old
Finally, try connecting again.
All these steps should update the keys on your device. If they are still not updated, you can contact our technical support service.