Sed delete key from known hosts

From thelinuxwiki
Revision as of 00:16, 21 March 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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