I\'ve reinstalled my server and I am getting these messages:
[user@hostname ~]$ ssh root@pong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
The sledgehammer is to remove every known host in one fell swoop:
rm ~/.ssh/known_hosts
I come up against this as we use small subnets of short-lived servers from a jump box, and frequently have internal IP address reuse of servers that share the same ssh key.
Simply clear the known_hosts which is present in /home/{username}/.ssh/known_hosts
vi /home/{username}/.ssh/known_hosts
remove every line inside known hosts and exit after that you will be able to login.
OR
run this command
ssh-keygen -R "hostname/ip_address"
Here is the simplest solution
ssh-keygen -R <host>
For example,
ssh-keygen -R 192.168.3.10
From ssh-keygen man page:
-R hostname
Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).I used the solution of mockinterface, though the sed -i didn't quite work I solved it by deleting the line by hand with vim:
sudo vim /var/lib/sss/pubconf/known_hosts
You can use any other text editor you want, but probably you'll need to show your administrative privileges
Use this command:
truncate -s 0 /home/SYSTEM_NAME/.ssh/known_hosts