Post a reply

Options
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)

Options

Topic review

Teo D

The server's host key not found in the cache. sporadic issue

Hi,

It's possible that you are running the script in a session that has no registered cache yet. Or maybe your running your script via services which will run under session 0 (in Win10 this is not accessible anymore). In any case, try doing a manual connection first using your login. Once you are connected, export the configurations to a ini file accessible for any users of the computer (try c:\temp\winscp.ini). That ini file contains the ssh finger print that is needed for the connection. For the execution of winscp.exe, add the argument /ini="[path of the ini file]". The application should work without the prompt or a need to verify the host/server.
martin

Re: Two host keys

kyokum wrote:

-hostkey="ssh-rsa 2048 key1;ssh-rsa 2048 key2"

This is correct.
kyokum

Two host keys

Would that be coded
-hostkey="ssh-rsa 2048 key1;key2"
or
-hostkey="ssh-rsa 2048 key1;ssh-rsa 2048 key2"
??
Lalit Kukreja

Automated script works 6 out of 10 runs but fails otherwise

Apologies for not being able to respond earlier than now.

Thank-you for your response.. I am still working with the other systems who own the server in question to get a confirmation regarding the point that you have highlighted above...

I should confirm it to you once I hear back from them.

Thanks again!! :)
martin

Re: The server's host key not found in the cache. sporadic issue

I assume the address you connect to load balances to two separate servers, each with a different host key.
You can specify multiple semicolon-separated hostkeys, like open -hostkey="key1;key2".
See https://winscp.net/eng/docs/scriptcommand_open
Lalit Kukreja

The server's host key not found in the cache. sporadic issue

Hi All,

The automated script is working in 6 out of 10 runs. Below are the messages that are received in success and failure scenarios.

================================================================
Success Message:
Executed as user: AccountName\UserID C:\Windows\system32>echo offbatch abort confirm off Searching for host...Connecting to host...Authenticating...Using username "UserID". Authenticating with pre-entered password.Authenticated. Starting the session...Reading remote directory...Session started. Active session: Other details
================================================================

Now the failure message:

Message
Executed as user: AccountName\UserID. C:\Windows\system32>echo offbatch abort confirm off Searching for host... Connecting to host...Authenticating... 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 XXXX 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. Continue connecting and add host key to the cache? (Y)es, (N)o, C(a)ncel, (C)opy Key: Cancel Host key wasn't verified! Host key fingerprint is ssh-rsa XXXX xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Authentication failed.

Any help on this please?