How to export known_hosts file from PuTTy

puttyssh

I am trying to kick the tires of JSch and SSH connect to remote (Solaris) host from Java locally. I normally use PuTTy, which gives me a prompt about an unknown host every time I connect somewhere for the first time, then I say yes and it no longer does it because it stores known hosts in the Win7 registry. But JSch expects a known_hosts file and I am not sure how to make it.

Can anybody instruct how to export the known_hosts from the Win7 registry into the file format? I cannot go into the registry directly because I am not an admin on my laptop (company policy). I can call desktop support and they will do it but I would rather not go through the step. I figure if PuTTy can access the registry when I am using it then it should be able to also export data out of it.

Any idea?

Thanks

Best Answer

The known_hosts file has a pretty standard format:

<hostname>[,<hostname2>...] ssh-rsa|ssh-dsa <ssh public key>

Ex.

example.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA0d7Aoure0toNJ+YMYi61QP2ka8m5x5ZQlT7obP8CK3eropfqsMPPY6uiyIh9vpiFX2r1LHcbx139+vG6HOtVvuS8+IfMDtawm3WQvRuOopz3vVy5GtMwtaOgehsXoT930Ryev1bH5myPtWKlipITsOd2sX9k3tvjrmme4KCGGss=

You could try just building it yourself.

Related Question