Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Thanks, I'll try that next time it happens. It's a bit annoying as it only happens every now and again and then I don't get enough time to test it out before the user reboots his workstation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.