Sed delete key from known hosts

From thelinuxwiki
Jump to: navigation, search

sed oneliner to delete offending key from known_hosts

error message from ssh client

Offending RSA key in /home/jsmith/.ssh/known_hosts:121

sed command specifying

sed -i '121d' /home/jsmith/.ssh/known_hosts

the above command will modify the known_hosts file in place with no backup