Winscp - Host key wasn't verified

11:52 PM 0 Comments

Your Winscp command runs manually but gives the following error when executed in a scheduled tasks, or SSIS

If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel. ()

Attempt to close connection due to fatal exception:

Host key fingerprint is ssh-rsa 1024 ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.

(Exception) **Host key wasn't verified!**

Closing connection.

Sending special code: 12


You need to specify the host key in the command line

option batch on
option confirm off

open sftp://test:test&@youripaddress:yourport  -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"


Thank you for your comments