[nSLUG] SSH timeouts (failure to login)

Eri Ramos Bastos bastos.eri at gmail.com
Fri Mar 19 14:27:22 ADT 2010

ssh  -o ConnectTimeout=10 user at host

Where 10 is in seconds.

Eri Ramos Bastos

On Fri, Mar 19, 2010 at 2:16 PM, InverseCow <rowan.townshend at gmail.com> wrote:
> Hello all, I am attempting to write a script which involves ssh'ing to a
> host to check if a process is running. I am hitting a wall though, in that
> some of the hosts may be "unresponsive" (pingable, but hung). As such, my
> SSH connection attempt "hangs" for a long time. Is there a method to have it
> timeout after a period of time (via SSH configuration options)? I have
> played with the "$TMOUT" value, as well I have tried using "ConnectTimeout
> 120" in my ~/.ssh/config, but to no avail. If need be, I could run this
> inside a WHILE loop, but would rather handle it more elegantly then that.
> Does anyone have else have any experience / tricks / voodoo magic on this
> topic? NOTE: This is purely for timing out on login, not to terminate "idle"
> sessions which have successfully connected. -Rowan Townshend
> "Just because I have a burnt face, doesn't mean I can't fight crime!" --
> http://www.burntfaceman.com/
> ________________________________
> View this message in context: SSH timeouts (failure to login)
> Sent from the nSLUG mailing list archive at Nabble.com.
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug

More information about the nSLUG mailing list