Topic "Automatically answer SSH question while connecting"

Author Message
huangpa
[View user's profile]

Joined: 2006-11-21
Posts: 1
Location: new york
While connection, the server asks:
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)ancel: No
How to answer this quesiton automatically in batch with user intervenience.

Regards,

Patrick
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Just do not do that. It breaks purpose of SSH. The only safe way is to pre-accept the host key in WinSCP configuration.
_________________
Martin Prikryl
quigel

Guest


prikryl wrote:
Just do not do that. It breaks purpose of SSH. The only safe way is to pre-accept the host key in WinSCP configuration.


I have a batch script which runs fine a few times (to copy files from NT to UNIX)then it starts giving the following error. What can I do? It again runs properly once I log in and run it manually.

Thanks.

. 2008-01-17 17:20:02.439 The server's host key does not match the one WinSCP has is cache. This means that either the server administrator has changed the host key, or you have actually connected to another computer pretending to be the server.
. 2008-01-17 17:20:02.439
. 2008-01-17 17:20:02.439 The new rsa2 key fingerprint is:
. 2008-01-17 17:20:02.439 ssh-rsa 1024 fc:3d:12:e0:44:f3:fc:b1:b8:4a:c7
. 2008-01-17 17:20:02.439
. 2008-01-17 17:20:02.439 If you were expecting this change and trust the new key, press Yes to update cache and continue connecting. If you want to carry on connecting but without updating the cache, press No. If you want to abandon the connection completely, press Cancel. Pressing Cancel is the ONLY guaranteed safe choice.
. 2008-01-17 17:20:02.439 ()
. 2008-01-17 17:20:02.439 Attempt to close connection due to fatal exception:
* 2008-01-17 17:20:02.439 Host key wasn't verified!
. 2008-01-17 17:20:02.439 Closing connection.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
quigel wrote:
I have a batch script which runs fine a few times (to copy files from NT to UNIX)then it starts giving the following error. What can I do? It again runs properly once I log in and run it manually.

If the fingerprint really changes (does it?), then it looks like someone is reinstalling the SSH server all the time. Or of course some may be spoofing your server.
_________________
Martin Prikryl
quigel

Guest


prikryl wrote:
quigel wrote:
I have a batch script which runs fine a few times (to copy files from NT to UNIX)then it starts giving the following error. What can I do? It again runs properly once I log in and run it manually.

If the fingerprint really changes (does it?), then it looks like someone is reinstalling the SSH server all the time. Or of course some may be spoofing your server.


Thank you Martin for your quick reply. The issue was I am using AFS and the connection may go to any server available and hence different keys for different servers. I got this resolved by entering the specific server in the stored session.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
quigel wrote:
Thank you Martin for your quick reply. The issue was I am using AFS and the connection may go to any server available and hence different keys for different servers. I got this resolved by entering the specific server in the stored session.

OK. The next version of WinSCP will allow storing of multiple keys for single host.
_________________
Martin Prikryl
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