(Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

Advertisement

syedshareefahmed@gmail.com
Joined:
Posts:
2

(Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

Hi,

I have a script(Batch file) for transferring files to a remote server with private keys provided by the party who owns the remote server. Sometimes I am receiving an error as below and files not been send.
"(Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7slq71crPirz+3ZkvwA5gulE="!**"

my batch file is given below.
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://user:password@remoteserver:10039/ -hostkey=""ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7slq71crPirz+3ZkvwA5gulE="" -privatekey=""E:\FTPPIL\lmsprdedi01.openssh"" -rawsettings AgentFwd=1 KEX=""rsa,ecdh,dh-gex-sha1,dh-group14-sha1,WARN,dh-group1-sha1""" ^
    "cd Outbox/eqmvmt" ^
    "lcd C:\LINES\ProdFTPEDIOUT\PIL\Coarri" ^
    "put *.* -nopreservetime" ^
    "lcd C:\LINES\ProdFTPEDIOUT\PIL\Codeco" ^
    "put *.* -nopreservetime" ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Kindly help me to resolve this issue, looking forward to your earliest support and co-operation.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,516
Location:
Prague, Czechia

Re: (Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

Where did you get the ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7slq71crPirz+3ZkvwA5gulE= from?
A fingerprint of the host key of the server you are connecting to is ssh-rsa 1024 2aQE3Q82arBxCXSCUeGF3HqfeYMh25YX9bVc5g1Qmhc=.
Either you have done something wrong or the hostkey has changed or you are under MITM attack.

Reply with quote

syedshareefahmed@...
Guest

Re: (Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

martin wrote:

Where did you get the ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7slq71crPirz+3ZkvwA5gulE= from?
A fingerprint of the host key of the server you are connecting to is ssh-rsa 1024 2aQE3Q82arBxCXSCUeGF3HqfeYMh25YX9bVc5g1Qmhc=.
Either you have done something wrong or the hostkey has changed or you are under MITM attack.

Thanks a lot Mr. Martin for responding.

I have got this fingerprint from the script WinSCP 'Generate Session URL/Code' of Manage option after login with credentials provided by the receiver of the files by remotely. And the host key also has provided by them.

A screenshot for reference also attached.
Description: The fingerprint of the host key got from Manage-> Generate Session URL/Code after login to WinSCP. And the host key provided by one of our stakeholders to receive files remotely.

Reply with quote

martin
Site Admin
martin avatar

Re: (Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

What if you first log in, then go to Session > Generate Session URL/Code?

Reply with quote

Advertisement

syedshareefahmed@...
Guest

Re: (Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

martin wrote:

What if you first log in, then go to Session > Generate Session URL/Code?

Dear Martin,
Yes, your are correct, the host key was generated when I do log then, goto Session > Generate Session URL/Code.

Reply with quote

martin
Site Admin
martin avatar

Re: (Exception) **Host key does not match configured key fingerprint "ssh-rsa 1024 KfH2Zul0c+lnIQ3vIRz7s

I'm not sure I understand. So is it working now?

Reply with quote

Advertisement

You can post new topics in this forum