LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2009, 05:15 PM   #1
rallymatte
LQ Newbie
 
Registered: Dec 2009
Location: London
Distribution: Centos, Ubuntu, Fedora
Posts: 2

Rep: Reputation: 0
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.
 
Old 12-10-2009, 06:12 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Turn on tcpdump, and see what is sended to hanging up computer and what is returned back?

Last edited by nimnull22; 12-10-2009 at 06:20 PM.
 
Old 12-14-2009, 04:35 PM   #3
rallymatte
LQ Newbie
 
Registered: Dec 2009
Location: London
Distribution: Centos, Ubuntu, Fedora
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
  


Reply

Tags
connection, ssh, timeout


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Centos hanging, console services/network down, no log info jackd1000 Red Hat 2 09-25-2008 03:54 AM
ssh -X very slow/hanging in Slackware 12 shivkiyer Slackware 4 10-07-2007 08:56 AM
ssh very slow/hanging in Slackware 12 shivkiyer Linux - Networking 5 10-05-2007 09:09 AM
Problem with ssh hanging, but only on Linux tomj88 Linux - Networking 12 05-28-2006 09:09 PM
Hanging Connection. rvoigt Linux - Newbie 1 09-13-2004 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration