SSH key update

SSH key update

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.
HTML
 
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
ML
 
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
 
HTML
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
HTML
 
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.
 
 
For more information, contact us.
    • Related Articles

    • Generate an SSH key on Windows using PuTTY

      First of all, you must download the SSH client PuTTY. We provide this link so that you can download the client. You can follow the guide SSH Key Update to see step by step how to install it. Once installed, you must run the application puttygen.exe: ...
    • Add SSH public key

      SSH keys are a secure and efficient way to authenticate on remote servers without having to enter a password each time you connect. If you need to generate an SSH key, especially on Windows, we recommend using PuTTY, a tool that allows you to easily ...
    • Basic SSH Manual

      Buy Web Domain and SSL Certificates With SSH access, you can work with your files and directories securely, connecting from an application or command-line interpreter. Below we provide an example of a command-line interpreter for each of the most ...
    • We update your Wordpress

      Do you want to update your WordPress and don’t know how? Are you not sure whether your WordPress needs to be updated? At cdmon we offer an update service that can help you update your WordPress to the latest version. What actions will the cdmon team ...
    • Wordpress Error: The key type is invalid

      It is possible that, when trying to access WordPress, you may encounter an error like the one shown in the following image: If you have installed the reCAPTCHA plugin on your WordPress website and you are seeing the error "Error for site owner: ...