[Feature Request] delete defined line in known_hosts file

Marc Haber mh+openssh-unix-dev at zugschlus.de
Sun Aug 22 19:58:00 EST 2010


Hi,

On Sat, Aug 21, 2010 at 12:48:25AM +1000, Damien Miller wrote:
> On Fri, 20 Aug 2010, Marc Haber wrote:
> > for a test lab, I'm trying to write a small shell script that will
> > eradicate all information regarding a special host from the
> > known_hosts file. Unfortunately, it is quite non-trivial to find out
> > what ssh doesn't like with a host.
> > 
> > ssh says which line in known_hosts has the offending key, but
> > ssh-keygen -R doesn't take a line number. Am I using an undocumented
> > interface when I simply use sed to delete the appopriate line?
> 
> not at all, the known_hosts is defined to be a file containing one
> key per line.

Thanks for that clarification, I'll use sed -i "${LINE}d" $FILE

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190


More information about the openssh-unix-dev mailing list