Re: ssh-keygen
Allan Wind wrote:
> On 2007-05-02T23:10:07-0400, KS wrote:
>> However, ssh-keygen gives me the exact same output if I try to do it
>> again even though the host does not exist in the file (same output with
>> -v flag). Shouldn't it give a more informative output like: host entry
>> not found in known_hosts file? Or am I missing something.
>
> So you did the following? If not give it a try where ... is hostname in
> question:
>
> hostname=...
> ssh-keygen -R $hostname
> ssh $hostname
>
Yup, that is exactly what I did and on doing ssh $hostname I got the
usual warning of authenticity of host $hostname (xxx.xxx.xxx.xxx) can't
be established. ...etc...etc.
That works fine. However, it is ssh-keygen which I think should return
something intelligent if it doesn't find a hostname entry to remove from
the known_hosts file. Below is what I get if I try to remove a
non-existent hostname listing:
00:09:15 {~} $> ssh-keygen -F hohoho.hahaha
00:10:16 {~} $>
00:09:18 {~} $> ssh-keygen -R hohoho.hahaha
/home/foobar/.ssh/known_hosts updated.
Original contents retained as /home/foobar/.ssh/known_hosts.old
So ssh-keygen does not return anything if it doesn't find a hostname
entry, and if asked to remove the same it says that the file was updated!!
/KS
Reply to: