"Host key does not match configured key" when uploading file to SFTP using WinSCP command

1.3k views Asked by At

I'm using SSIS to upload files to SFTP. I'm using command prompt to execute the WinSCP command. Code is as below:

winscp.com /command  "open sftp://[email protected]/ -privatekey="H:\Share\CT_SFTPPrivateKey\privatekey.ppk" -hostkey=""ssh-ed25519 256 71yCy6d6qLSxxX5dZ/+99On+8xiDnJ4NG7tXmKiOMik=."""  "put -delete  H:\Share\WorkingFolders\BOPIS\*.csv /sc/production/incoming/segment/" /log="H:\Share\WorkingFolders\BOPIS\WinSCP.log" "exit"

I'm getting Host key does not match configured key exception.

1

There are 1 answers

0
Martin Prikryl On BEST ANSWER

The . at the end of your host fingerprint should not be there.

-hostkey=""ssh-ed25519 256 71yCy6d6qLSxxX5dZ/+99On+8xiDnJ4NG7tXmKiOMik=""

WinSCP GUI can generate a complete valid command-line template for you.