ssh timeout

Hearn, Stan J. stan.hearn at nscorp.com
Fri Sep 25 17:05:15 UTC 2009


>From: redhat-sysadmin-list-bounces at redhat.com [mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of >nitin.gizare at wipro.com
>Sent: Friday, September 25, 2009 12:47 PM
>To: redhat-sysadmin-list at redhat.com; redhat-sysadmin-list at redhat.com
>Subject: RE: ssh timeout
>
>HI
> 
>Thanks but, some time I see that we can ping machine but server is hung state in which case I can not run ssh >or can not connect at all.
> 
>in such cases my script just stops and wating for host to respond 
> 
>Rgds
>Nitin


Good point, just because ping is working doesn't mean ssh will.

Doesn't the ssh connection eventually time out and then your script continues?  You mentioned "But if one of machine is down script does not go forward and will be waiting for to come up and complete ssh connections."  It should wait about 60 seconds, right?  But then continues to process the rest?

My suggestion was to take a single threaded process and make it multi-threaded by back grounding the individual connections.   Keep in mind that lowering the ConnectionTimeout value may have an adverse effect for busy systems that take longer than usual to respond.  The built-in TCP timeout should be enough of timeout.  If your script is hanging that could be another completely different issue.

Thanks,
Stan





More information about the redhat-sysadmin-list mailing list