Re: use openssh in script for timeout

From: Darren Dunham (ddunham_at_redwood.taos.com)
Date: 03/15/04


Date: Mon, 15 Mar 2004 17:33:39 GMT

hmc <nospam@nospam.com> wrote:
> Hi,
> I have a bash script that use openssh to go to a list of machines to
> run a program.
> I want the script to try the next host if the current host does not
> response in a certain period or prompt for password.
> Is there a option to do this?

You may want to set ConnectionAttempts and ConnectTimeout. I usually
set ConnectTimeout to 5 seconds for scripts when I'm working with known
machines in a LAN.

Of course 'BatchMode=yes' is usually beneficial. Set up keys and run an
agent rather than typing in passwords.

And finally you can set all this stuff in a config file. I usally keep
one just for a script and call that config explicitly..

ssh -F script.config -l $user $host $command

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >


Relevant Pages

  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.solaris)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.shell)
  • RE: Another overflow exploit for Apache? *RESOLVED*
    ... You must be reviewing already backdoored script. ... > On ALL the machines with the Ddos behavior we found, ... > Ddos binaries, then executing them.. ... > This script is most likely used by CCBILL techs as part of their default ...
    (Incidents)
  • Re: Win2000 Pro will not process logon script
    ... newer machines run the script and some of the older ones do not. ... I am not familar with the "slow link" policy. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Win2000 Pro will not process logon script
    ... newer machines run the script and some of the older ones do not. ... I am not familar with the "slow link" policy. ...
    (microsoft.public.windows.server.active_directory)