Topic "The server's host key was not found in the cache"

Author Message
Guest




Hi Experts,

I am trying to execute a batch through the task scheduler and fails with the below error. But when i try to run the batch manually it works fine. Please help, its quiet urgent.

Below is my code:-
===================

"C:\Program Files (x86)\WinSCP\winscp.com" /command "open sftp://XXXXX:XXXXXX@XXXXXX.XXXXXX.com" "ls" "cd WORK" "get TEST*.txt E:\TESTFOLDER\" "exit"

Below is the log:-
==================

Continue connecting to an unknown server and add its host key to a cache?
The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
(Y)es, (N)o, C(a)ncel, (C)opy Key: Cancel
Host key wasn't verified!
Host key fingerprint is ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX

Authentication failed.

Thanks,
Uday
Advertisements
uda2k2
[View user's profile]

Joined: 2014-03-18
Posts: 1
Any helps please?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
See
http://winscp.net/eng/docs/faq_scheduler
http://winscp.net/eng/docs/scripting#hostkey
_________________
Martin Prikryl
Guest




Thanks, but the above post did not help me.
Guest




Any helps to this, urgent please!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Quote:
Thanks, but the above post did not help me.

You have to be more specific. What is the problem? You do not understand it? Or you did try to follow the instructions (which specifically?) and it did not help?
_________________
Martin Prikryl
Guest




Tried this way, but still it's nor working. Suggestions please

"C:\Program Files (x86)\WinSCP\winscp.com" /command "open sftp://XXXXX:XXXXXX@XXXXXX.XXXXXX.com" /hostkey="ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX" "ls" "cd WORK" "get TEST*.txt E:\TESTFOLDER\" "exit"
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
It should be:
Code:
... /command "open sftp://XXXXX:XXXXXX@XXXXXX.XXXXXX.com -hostkey=""ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX""" "ls" ...


And make sure you use actual fingerprint, not the XX:XX:XX...
Guest




Tried this way but still same error Sad Please help.

c:\TEST>"C:\Program Files (x86)\WinSCP\winscp.com" /command "open sftp://XXXXXXXXXX:XXXXXX@XXXXXXXXXXXXXXX -hostkey=""ssh-rsa 2048 ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX""" "ls" "cd TEST" "get -TEST*.txt C:\TEST\" "exit"
Searching for host...
Connecting to host...
Authenticating...
Continue connecting to an unknown server and add its host key to a cache?
The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
(Y)es, (N)o, C(a)ncel, (C)opy Key: Cancel
Host key wasn't verified!
Host key fingerprint is ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.

Authentication failed.
Sad Sad
Guest




prikryl wrote:
It should be:
Code:
... /command "open sftp://XXXXX:XXXXXX@XXXXXX.XXXXXX.com -hostkey=""ssh-rsa 2048 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX""" "ls" ...


And make sure you use actual fingerprint, not the XX:XX:XX...


Thanks a lot, it worked! Very Happy
53Alpha

Guest


Thanks for the information. Now the files being transferred are getting permission denied. Where I can manually move the files without a problem.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License