Tuesday, January 29, 2008

ssh accept remote fingerprint via non-interactive command line

I keep running into having to press 'P' to add fingerprints permanently into the registry when using putty's pscp and plink.

But a lot of the time I don't have physical access to the machines that are running these scripts, however help is at hand.

All you have to do is:
  1. Accept the fingerprint to the server from your local machine
  2. Run RegEdit, and goto HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys
  3. Select the keys for the machines you wish to authorise and then click File / Export to save these to a .reg file.
  4. On the remote machine, run RegEdit /s myHostsToRegister.reg
Once this is done you should be able to ssh fine.

For Unix, apparently the putty keys are stored here: ~/.putty/sshhostkeys
See Also a python script to upload from a known_hosts file

No comments: