Thursday, January 24, 2013

Remove line by vi in known_hosts file

When IP of servers are changed you got:

[roman@local ~]$ ssh my_server
Warning: the RSA host key for 'cheetah' differs from the key for the IP address '192.168.153.156'
Offending key for IP in /home/roman/.ssh/known_hosts:3
Matching host key in /home/roman/.ssh/known_hosts:76
Are you sure you want to continue connecting (yes/no)?

We need to remove old server info online 3:
vi /home/rivanov/.ssh/known_hosts +3
press to remove current line"
"dd"
save:
:wq

Enjoy.!

No comments:

Post a Comment