Host key does not match configured key - Error

Advertisement

DaveJJ07
Joined:
Posts:
1
Location:
Vermont

Host key does not match configured key - Error

I cannot connect to a new SFTP connection I setup. I keep getting the following error (Error log). What causes the error: “Host key does not match configured key”? My script is shown at the bottom.

Error Log
. 2021-12-29 15:27:08.171 Looking up host "oft.MyConnection.com" for SSH connection
. 2021-12-29 15:27:08.265 Connecting to 999.99.99.999 port 22
. 2021-12-29 15:27:08.296 We claim version: SSH-2.0-WinSCP_release_5.9.3
. 2021-12-29 15:27:08.343 Server version: SSH-2.0-Welcome to SFTP (PRD1)
. 2021-12-29 15:27:08.343 We believe remote version has SSH-2 channel request bug
. 2021-12-29 15:27:08.343 Using SSH protocol version 2
. 2021-12-29 15:27:08.343 Have a known host key of type dss
. 2021-12-29 15:27:08.343 Doing Diffie-Hellman group exchange
. 2021-12-29 15:27:08.421 Doing Diffie-Hellman key exchange with hash SHA-256
. 2021-12-29 15:27:08.671 Host key fingerprint is:
. 2021-12-29 15:27:08.671 ssh-rsa 2048 f2:20:66:d3:36:e4:54:1e:ff:c5:ed:02:8b:38:db:52
. 2021-12-29 15:27:08.671 Verifying host key rsa2 0x10001,0xacae387f9b7829ed 2a88528528b6e667 645039044b05d3c0 5f49916442c31f80 791a133da6188dac ea05fbc91a10db8b d2e1dbd85ae0cadb 1b4ab8e6b19c54c8 e7620067c78fc620 ac12822a2217b03a 0362038f25afa256 e036acec8662fc2f 955bfe27d4978336 1a31479c117a9232 582f84fd6e05638a 83f0e15700b30e5c d3e6cafa73bbc4ad 11902003f9f3281b 0171ac3e4708cf48 5d7813d5c56a3abc 6ff8bc1bc86ca8f7 72ffbb13f18db21c d7b2006cc5ecbcbe 76a8bb867934092d c9b0099fa0a35aa9 d442cb1a58abbef4 4e7d6f0b98a66702 c713b80f7792ef1d dff26e6b97436fe7 b9fb03daa60c4d52 3ab8f84fc31cb043 02353e5eb076f5cf  with fingerprint ssh-rsa 2048 f2:20:66:d3:36:e4:54:1e:ff:c5:ed:02:8b:38:db:52
. 2021-12-29 15:27:08.671 Host key does not match configured key ssh-dss 1024 2b:4c:31:e9:d8:0d:be:fb:de:a1:86:d7:a8:63:39:f8
. 2021-12-29 15:27:08.671 Attempt to close connection due to fatal exception:
* 2021-12-29 15:27:08.671 Host key fingerprint is ssh-rsa 2048 f2:20:66:d3:36:e4:54:1e:ff:c5:ed:02:8b:38:db:52.
* 2021-12-29 15:27:08.671 (Exception) **Host key does not match configured key "ssh-dss 1024 2b:4c:31:e9:d8:0d:be:fb:de:a1:86:d7:a8:63:39:f8"!**
. 2021-12-29 15:27:08.671 Closing connection.
. 2021-12-29 15:27:08.671 Sending special code: 12
Script...
open sftp://MyClient9999@oft.MyConnection.com/ -hostkey="ssh-dss 1024 2b:4c:31:e9:d8:0d:be:fb:de:a1:86:d7:a8:63:39:f8" -timeout=10 -privatekey="E:\Lockbox Import Files\Script Files\MyPrivateKey.ppk" -passphrase="mypassword"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
37,591
Location:
Prague, Czechia

Re: Host key does not match configured key - Error

The error is caused by what the error says. The hostkey fingerprint in your script:
-hostkey="ssh-dss 1024 2b:4c:31:e9:d8:0d:be:fb:de:a1:86:d7:a8:63:39:f8"
does not match the fingerprint of the actual host key:
ssh-rsa 2048 f2:20:66:d3:36:e4:54:1e:ff:c5:ed:02:8b:38:db:52

I guess you did not update the fingerprint in your script after you have changed the server.

See also https://winscp.net/eng/docs/faq_hostkey

Reply with quote

Advertisement

You can post new topics in this forum