Remote host identification has changed
If you see the error message "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" when trying to SSH into a remote server, it means that the server's key has changed since the last time you connected to it. This can happen for a variety of reasons, such as the server being re-installed or moved to a different location.
To fix this error, you can remove the old key from your `known_hosts` file and add the new key. Here are the steps:
1. Open your `known_hosts` file using a text editor. This file is typically located in your home directory, under `.ssh/known_hosts`.
2. Find the line that corresponds to the remote server that you are trying to connect to. It will look something like this:
```
remote_server_ip_address ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0z7t...
```
3. Delete the entire line that corresponds to the remote server.
4. Try to SSH into the remote server again. This time, you will be prompted to add the new key to your `known_hosts` file.
5. Verify the fingerprint of the new key and confirm that you want to add it to your `known_hosts` file. The fingerprint should match the fingerprint provided by the server's administrator.
6. After confirming the fingerprint, the new key will be added to your `known_hosts` file and you should be able to SSH into the remote server without any issues.
Note that removing the old key from your `known_hosts` file can be a security risk if you are not sure why the key has changed. If you are in doubt, you should contact the server's administrator to confirm that the new key is legitimate.
To fix the "remote host identification has changed" error using `ssh-keygen -R`, you can follow these steps:
1. Open a terminal or command prompt on your local machine.
2. Enter the following command: `ssh-keygen -R remote_ip` where `remote_ip` is the IP address or hostname of the remote host that you are trying to connect to.
3. You should see a message indicating that the old key for the remote host has been removed from your known_hosts file.
4. Try connecting to the remote host again using SSH. You should be prompted to accept the new key for the remote host. Verify that the key fingerprint matches the one provided by the remote host administrator, and then confirm that you want to connect to the remote host.
5. If you are able to connect successfully, you should be able to continue using SSH to connect to the remote host without seeing the "remote host identification has changed" error.