|
ssh connection hanging centos
I've basically written a script that connects to a number of machines (only after pinging them to see that they're alive), however I'm having some issues when a machine is semi-crashed.
The machine that has crashed is responding to ping and seems to be able to establish an ssh connection but doesn't get any further. There's is nothing on the screen of the computer that has crashed, but that doesn't really matter as what the real issue is that my script hangs, so when I come in in the morning, the script hasn't run and is still hanging.
I've tried changing the ConnectTimeout option, but it doesn't seem to make any difference. The output from doing an ssh on the commandline to that machine is this:
-bash-3.00$ ssh -v -o ConnectTimeout=1 host
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data ~/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to host [10.0.0.3] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file ~/.ssh/identity type -1
debug1: identity file ~/.ssh/id_rsa type -1
debug1: identity file ~/.ssh/id_dsa type 2
And after that nothing happens, this is on a CentOS 4.4 machine.
However, on a Mac OS X (10.5) when I run the same command it actually times out (won't timeout if you don't set the ConnectTimeout option). Please see below.
mac:~ user$ ssh -v -o ConnectTimeout=1 host
OpenSSH_5.2p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data ~/.ssh/config
debug1: Applying options for *
debug1: Applying options for host*
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to host [10.0.0.3] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file ~/.ssh/identity type -1
debug1: identity file ~/.ssh/id_rsa type -1
debug1: identity file ~/.ssh/id_dsa type 2
Connection timed out during banner exchange
The obvious difference is the version of ssh itself, but an upgrade is not actually possible on the CentOS machine at the moment. Does anyone know if there is a way to make the ConnectTimout to actually work with ssh 3.9? Has anyone come across this before?
Last edited by rallymatte; 12-10-2009 at 05:39 PM.
|