Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review

Hostkey not recognized if logged off of machine

Nevermind, user error! I copied and pasted the host key to my script and this time it worked! :)

Hostkey not recognized if logged off of machine

Sorry, I meant to include a snipit of the hostkey. I double checked and it's the same as what's in my script.

Hostkey not recognized if logged off of machine

Thanks for replying to my question post Martin! How then do I establish the correct fingerprint that I can use for my script?

thanks so much for your help!

Re: Hostkey not recognized if logged off of machine

The hostkey fingerprint in your script is most likely incorrect. Your SQL server account probably has the correct hostkey cached in Windows registry, so WinSCP uses the cache to verify the host key, despite incorrect fingerprint in your script.

Somewhat related to:
My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?

If you believe otherwise, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Hostkey not recognized if logged off of machine

I have a batch script that I initiate from an SSIS Package that is launched from a job in SSMS. When I am logged on my SQL Server, I can launch my job and it connects fine, but when I am not logged into the SQL Server, it fails, saying the "Host key does not match configured key fingerprint...". I need my batch script to work when I'm not logged into my SQL Server.

This is my script:
option confirm off
open sftp://xxxxxx -hostkey="xxxxx"
cd /upload
get -latest "%1%" "%2%"\

I tried using a password, but per the logs, it's asking if I want to continue, which I can't respond, as it's coming from my script.

How do I resolve this?