Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to ssh to particular machine/s in a list, The SSH command happens to be freezing. I tried out setting ssh timeout. But then also it's freezes even after the timeout.

In verbose mode :

OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [10.x.x.x] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /export/home/sqlrpt/.ssh/identity type -1
debug1: identity file /export/home/sqlrpt/.ssh/id_rsa type -1
debug1: identity file /export/home/sqlrpt/.ssh/id_dsa type 2

At this point it freezes.

A work around I thought was to create a child process for each ssh calls and if the process doesn't respond after a timeout - Kill it. But are there any less complex ways, so that I can accommodate it in a shell script itself rather than going for a C/C++ program ?

share|improve this question

migrated from Mar 8 '12 at 11:25

This question came from our site for professional and enthusiast programmers.

Try running the ssh command with -vv or even -vvv to increase verbosity - you might get more information that way. – D_Bye Mar 8 '12 at 10:35
Programming question or admin question? – glglgl Mar 8 '12 at 10:37
Why such ancient versions of OpenSSH & OpenSSL? – Spiff Mar 8 '12 at 12:09
Can't help it much as they are managed by a different colo. and the only way is just to go with this :| – NS Gopikrishnan Mar 8 '12 at 12:44
ssh -2 -o ConnectTimeout=5

This did the trick. It's no more getting stuck

share|improve this answer

probably, you found this bug
it was duplicated here , and there is a workaround for it

echo 0 > /proc/sys/net/ipv4/tcp_default_win_scale
share|improve this answer
can you make it more clear? What really is the work around ? – NS Gopikrishnan Mar 27 '12 at 8:16

I had this same kind of annoying problem with openSuse 11.4 (x86_64) (kernel, SSH-version: OpenSSH_5.8p1, OpenSSL 1.0.0c 2 Dec 2010.

echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

Did the trick and problem is now solved.

share|improve this answer

I think the problem is with the host's internet.This has happened to me several times.Right before ssh turn the hosts internet off and then back on.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .