ConnectTimeout=2 not working for me
Bryan Whitehead
driver at megahappy.net
Sat Dec 26 08:07:04 EST 2009
Try using ServerAliveInterval=3 and a reasonable ServerAliveCountMax as
well. The full TCP handshake could be happening but then sshd might not be
doing anything with the established tcp connection. ConnectTimeout will only
bail if there is a problem setting up the connection. Once the connection is
established ConnectTimeout's job is done.
On Thu, Dec 24, 2009 at 1:31 PM, Vahid Moghaddasi <
vahid.moghaddasi at gmail.com> wrote:
> Hi all,
>
> I have somewhat a strange problem that I could not figure out, maybe
> someone
> here can lelp.
>
> I have a script that uses scp to distribute files to many servers, I use
> '-o
> BatchMode=yes -o ConnectTimeout=2 options so the scp will not get stuck if
> something is wrong with the remote host.
>
> If the remote host is down (non-pingable) or sshd is down the timeout
> option
> works and the scp continues to the next host in 2 seconds, but if the host
> is up (pingable) and sshd is listening on port 22 and host is either in
> trouble e.g. irresponsive then ssh connection hangs and wont every timeout.
>
> In that case, I will have to logon to the server initiating the scp and
> kill
> that process so the script will continue to run.
>
> Is there any option that I can use to just disconnect the scp connection in
> a given time, regardless of the scp is actually transferring file or not so
> the connection wont hang for ever? The actual transfer time is about 5
> seconds. I have just upgraded ssh to 5.2p1 but no help. The remote servers
> platforms are AIX, Linux and Solaris and I see this behavior on all at some
> point.
>
> Thank you,
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>
More information about the openssh-unix-dev
mailing list