[clue-tech] ssh, vim helper

Adrian Noland anoland at indigente.net
Mon Oct 20 06:36:23 MDT 2008


On Sun, Oct 19, 2008 at 11:33 PM, Keith Hellman
<khellman at mcprogramming.com>wrote:

> On Thu, Oct 16, 2008 at 09:26:59PM -0600, David L. Willson wrote:
> > Well, I get them all the time, and I found the easy way to delete the old
> key, but
> > quick.  Notice that it gives you the line-number of the offending key, so
> you can use
> > the "start at line" shortcut when starting vim to go straight to it when
> you edit your
> > known_hosts file.  Like this:
> >
> > dlwillson at aurora:~
> > $ vim +95 .ssh/known_hosts
> >
> > Now, you just key in ddZZ (dd deletes the bad key, and ZZ saves and
> quits) and try your
> > ssh again.
>
> You can avoid vim altogether with (ironic me saying this, because I
> really like vim):
>  $ sed -i 95d ~/.ssh/known_hosts
>

Or:
man ssh-keygen
     -R hostname
             Removes all keys belonging to hostname from a known_hosts
file.  This option is useful to delete hashed
             hosts (see the -H option above).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue-tech/attachments/20081020/21dee087/attachment.html


More information about the clue-tech mailing list