So.
We have OpenSSH on our servers.
In an application I wrote, we make a connection to that server using Plink in a batch.
However, at first connect, it will ask us if you want to accept the Server Host key.
This is the base security model, to prevent man-in-the-middle attacks.
However, my application is running this, in a batch script, and it's impossible to answer that question, which causes my application to hang.
I can circumvent this by connecting to putty first manually and accepting the key.
This creates a Registry key in HKEY_CURRENT_USER\SoftWare
\SimonTath
am\PuTTY\S
shHostKeys
for example:
key name: rsa2@22:192.168.2.168
value:
0x23,0xb4f03e7341bd5890474
d34ac60771
9fb8af5856
f9d005d3fd
027cb8a247
e5b3b451db
126b6bb5d2
184182bef5
fc3a3bb4d9
e76d9e4118
4500f55358
30ddd21e7d
cbab0a7db9
dc557ca0ea
73e8e046bf
f8ab56af87
c70b019cda
b4947f4c94
1667096d96
5c9347cf55
882a5df929
af93ad2e7b
a0dcb8b682
f0d5d1b1f7
c495aa3d98
34f48a2829
372c932135
92eed34107
34b5aa9f4a
d895cab599
e1010d48fc
966b3ee908
141b1b621f
0720882ec8
259a187cab
492135fe9f
658298f8c3
56943ade8c
0889456010
a2b2e9a80b
b0583baa60
c99ea34653
04bf7c99e6
c5787a1bbf
487e76806c
0e414439f5
77caa1607e
002a1330ed
111c75c0e6
fbc2c8be0d
0ad
This is what I know do in the script.
I set the registry key myself, before running the plink connection.
this works perfectly.
However, I want to do this fully automated.
Right now, I have to generate the value of that regkey first by running PuttY on a client, connecting manually, and copying the regkey.
To maintain our security, we want to send the SshHostKeys over a secure SSL connection, and set them in the registry every time before we connect. That way, the key would be verified, and get accepted.
Therefor, I need the value that Putty puts in the registry key.
I have the SSH Host key, but PuTTY seems to hash it, or encrypt it in some way, before it puts it in the registry.
How do they do that?
Using what algorithm/seed?
Simply put:
I have the server host key. How do I convert it into a registry key that PLink/PuTTY will accept?
Start Free Trial