lunedì, maggio 23, 2011

Putty host key fingerprints when running as Local System

Running Putty's PSCP as "Local System" can give you a little headache since the very first time you try to connect to a new host is asks you if you wish to save the host key fingerprint and there is no way to automate the process of answering Y or N.

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 f6:ec:b1:ec:1d:94:34:77:7e:0c:db:47:9f:47:4a:45
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) Connection abandoned.

Therefore a good solution to the problem is to run PSCP as a normal user and to copy the fingerprint from the normal user registry key to the following one:

HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys

Nessun commento: