Host Identification has changed for no obvious reason
This is the error I'm getting when I tried login in to my server
ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ECDSA key sent by the remote host is
SHA256:nLdtZYZ3MPLkpSPFJWFEO0bn8/mlG3Oe0NtEYdKbcNU.
Please contact your system administrator.
Add correct host key in /home/abayomi/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/abayomi/.ssh/known_hosts:3
remove with:
ssh-keygen -f "/home/abayomi/.ssh/known_hosts" -R "143.110.229.222"
ECDSA host key for 143.110.229.222 has changed and you have requested strict checking.
Host key verification failed.
OK I just successfully removed the previous hostname, I then tried to do this
ssh 143.198.104.166
I'm now getting this error
[email protected]: Permission denied (publickey).
my user no longer has access to login to the server.
-
ssh
Secure Shell - is a program for logging into a remote machine and for executing commands on a remote machine. - To connect remote server you have to install "ssh server" Secure Shell Daemon -
sshd
. -
sshd
usually listen to port 22 and you can connect the ssh server by using the commandssh username@hostname
- You can change your ssh server configuration by editing the configuration file
/etc/ssh/sshd_config
-
To your specific question:
- The known_hosts problem may cause because you're using the same remote computer address as before but the remote computer is responding with a different fingerprint.
- Therefore as i commented the command
ssh-keygen -f "/home/abayomi/.ssh/known_hosts" -R "143.110.229.222"
will solve the warning message problem. - The "permission deniend" error caused because you do not have keys to the specific server.
- To add more keys to ssh server you have to add your public key to the authorized_keys file which located on
/home/username/.ssh/authorized_keys
or in the root user/root/.ssh/authorized_keys
. - To generate new keys you can use the
ssh-keygen
command.