View Single Post
  #4   (View Single Post)  
Old 21st December 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 773

Thanks for the clear explanation, J65nko. I hadn't noticed the line number being in the error message, and wasn't familiar with the hashing option either. So your approach to the problem makes sense to me now.

For what it's worth, here's an alternate approach that occurred to me overnight. It wouldn't work with hashing turned on, but would remove multiple lines if applicable. First one could look up the relevant key in known_hosts, either using the line number or by supplying the host name or IP instead. Then one could remove all lines containing that key using grep -v (for example).

Originally Posted by J65nko
Because I am consistently lazy I hardly have multiple entries for the same host.
Maybe my problem is being inconsistently lazy.
Reply With Quote