Re: Forcing SSH to timout after a certain time if it isn't responding

From: andy (andy_at_wpi.edu)
Date: 11/19/03

  • Next message: Darren Dunham: "Re: Forcing SSH to timout after a certain time if it isn't responding"
    Date: 19 Nov 2003 12:50:53 -0800
    
    

    I tried using
    ssh -o BatchMode=yes -o ConnectTimeout=2 <ip.add.re.ss> /bin/true >
    /dev/null

    But it gives me the follwing error:
    command-line: line 0: Bad configuration option: ConnectTimeout

    I looked in my ssh_config file, and also in 'man ssh_config', and i
    didnt see ConnectTimeout mentioned in either place.

    Does this mean I have an older version of ssh? Is there any otehr way
    I can ahceive that functionality?

    Darren Dunham <ddunham@redwood.taos.com> wrote in message news:<Rgyub.6710$3E7.55264382@newssvr21.news.prodigy.com>...
    > In comp.security.ssh andy <andy@wpi.edu> wrote:
    > > Hi,
    >
    > > I'm wiritng a Bash script where I want to check if I can SSH into a
    > > certain IP-address in a function. If the SSH call does nto respont for
    > > 2 seconds I want to kill the process, but if it responds before 2
    > > seconds then it
    > > shudnt have to wait unnecessarily for 2 seconds.
    >
    > > here the code i was trying:
    >
    > [snip]
    >
    > Why not just specify the connection timeout?
    >
    > > `ssh -q "$1" /bin/true &> /dev/null &`
    >
    > Note that -q turns off messages, but it does not prevent the client from
    > asking necessary interactive questions... You'd need BatchMode for that.
    >
    > ssh -o BatchMode=yes -o ConnectTimeout=2 /bin/true > /dev/null


  • Next message: Darren Dunham: "Re: Forcing SSH to timout after a certain time if it isn't responding"

    Relevant Pages