Automatically answer SSH question while connecting

Advertisement

huangpa
Joined:
Posts:
1
Location:
new york

Automatically answer SSH question while connecting

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Automatically answer SSH question while connecting

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

Reply with quote

quigel
Guest

Re: Automatically answer SSH question while connecting

martin 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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Automatically answer SSH question while connecting

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.

Reply with quote

quigel
Guest

Re: Automatically answer SSH question while connecting

martin 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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Automatically answer SSH question while connecting

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.

Reply with quote

Advertisement

You can post new topics in this forum