ConnectTimeout=2 not working for me

Dan Kaminsky dan at doxpara.com
Fri Dec 25 08:38:33 EST 2009


I'll be honest, I've never had much luck with scp.  It freezes, alot.

I always recommend:

cd dir; tar czf - dir | ssh user at host "tar xzvf -"

or

cd dir; ssh user at host "tar czvf -" | tar xzf -


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