[NBLUG/talk] Setting a timeout for SSH

Lincoln Peters anfrind at gmail.com
Fri Sep 26 13:55:29 PDT 2008


I've written a shell script that uses SSH to log into a bunch of
servers and report whether or not a particular program is running on
each of them.  Occasionally, one of the machines will fail and SSH
will stall, and I need to cancel the login attempt (it doesn't matter
what's running on the machine if I can't SSH into it).  Is there some
way to set up a timeout on an SSH login?

All of the servers have public-key authentication set up (no passwords
needed), and as far as I'm aware, there is no way to determine if the
program is running without running a "ps" command locally (hence the
need for SSH).


Thanks in advance.


-- 
Lincoln Peters
<anfrind at gmail.com>



More information about the talk mailing list