LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-06-2007, 11:17 AM   #1
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Rep: Reputation: 0
ssh "Connection Refused" requires networking restart (?)


I have an openssh-server running on Ubuntu 7.04. Frequently, the server just suddenly becomes impossible to connect to; existing and new putty clients see "Network error: connection refused" messages.

I found that i need to do "/etc/init.d/networking restart" to get past this problem without restarting sshd (Restarting sshd doesn't help). The auth.log file does not contain any pointers.

Would greatly appreciate any suggestions for a remedy to avoid this issue or any tips as to where to start looking.

Thanks
Vish
 
Old 08-06-2007, 11:58 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
No need to keep posting the same thread all over the place...

A couple ways I would think about troubleshooting this:

1) Is the output of /sbin/ifconfig showing any error packets on the box hosting sshd?

2) When things begin failing, do the connections even reach the listening sshd daemon? Not sure where to check this under Ubuntu -- perhaps /var/log/secure or /var/log/messages.

If it's necessary, you can turn on DEBUG logging level for sshd for a short time to try to get more information; again, this assumes the connections are reaching the listening sshd daemon. (See the manpages for sshd_config(5) under the LogLevel parm.)
 
Old 08-06-2007, 01:56 PM   #3
soroccoheaven
Member
 
Registered: Jul 2007
Distribution: mandrake Mandriva Redhat CentOS Slackware
Posts: 221

Rep: Reputation: 30
Quote:
Originally Posted by donnoit
I have an openssh-server running on Ubuntu 7.04. Frequently, the server just suddenly becomes impossible to connect to; existing and new putty clients see "Network error: connection refused" messages.

I found that i need to do "/etc/init.d/networking restart" to get past this problem without restarting sshd (Restarting sshd doesn't help). The auth.log file does not contain any pointers.

Would greatly appreciate any suggestions for a remedy to avoid this issue or any tips as to where to start looking.

Thanks
Vish
it seems to be a network/connection prob..try to ping when the problem occurs..and /etc/init.d/network restart (if you are not able to ping)
/sbin/ifconfig eth0/ethn can be useful too.
 
Old 08-07-2007, 10:58 AM   #4
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Mysterious IPv6 router message

I upped the LogLevel for sshd to DEBUG3 (highest) but a connection attempt did not cause any output to the log (auth.log is the log configured in sshd_config). Seems like connections don't even reach the listening sshd daemon.

(Of course, when I do a networking restart, connections can once again be made successfully and the auth.log gets a lot of logging lines.)

I seem to get this abnormal condition within 10-15 minutes of a networking restart. But the output of /sbin/ifconfig does not indicate any error packets. And I can also successfully ping to and from the box when the "Connection Refused" message is seen.

I see only one mysterious clue in kern.log file:

Aug 6 03:08:00 abclinux01 kernel: [332548.338214] eth0: link up
Aug 6 03:08:10 abclinux01 kernel: [332548.338214] eth0: no IPv6 routers present


The two statements are 10 seconds apart. I wonder whether this has any bearing on my sshd problem.
 
Old 08-07-2007, 11:43 AM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
So we can (probably) be pretty certain the problem does not lie with sshd. It appears that connections stop reaching the sshd daemon altogether, and it doesn't sound like you need to restart sshd at any time.

Quote:
Originally Posted by donnoit
Aug 6 03:08:00 abclinux01 kernel: [332548.338214] eth0: link up
Apart from the obvious, I'm not sure what to make of that. Is it appearing at exactly the time the network connection seems to die?

Do you have a spare ethernet card and cable you can swap the originals with to see if the problem continues?

edit: typo.

Last edited by anomie; 08-07-2007 at 12:28 PM.
 
Old 08-07-2007, 04:42 PM   #6
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Original Poster
Rep: Reputation: 0
problem is sporadic..

Today, I noticed once that the connection problem (with sshd and apache) seemed to rectify itself temporarily..

Last edited by donnoit; 08-07-2007 at 04:45 PM.
 
Old 08-07-2007, 04:43 PM   #7
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Some more info on the connection problems

Thanks for the helpful advice I've recd from anomie and sorrocoheaven.

Unfortunately I do not have another ethernet card to try out. One thing which is special in my situation is that I am running Ubuntu in a VMWare instance.

My connections problems do begin soon after (or as soon as) the "eth0: link up" message appears. I also looked at an apache webserver which I am running now. The webserver ALSO seems to be affected when I have the connect problems with sshd. But I can still do a local connection to ssh (from the same machine) even with the connection refused error that I see from other machines in the network.

After doing some research, I also did an iptables invocation to see if any firewall rules are active

iptables -L -n

The result was:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

which I'm told means no firewall running. Also did an "nmap -r localhost" which tells me that my ports are open.

Today, I noticed once that the connection problem (with sshd and apache) seemed to rectify itself temporarily also which has me completed foxed. Would greatly appreciate any other ideas/suggestions to debug the issue or track the network interface.

Thanks
Vish
 
Old 08-08-2007, 05:20 PM   #8
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Original Poster
Rep: Reputation: 0
This is not an SSH-only issue after all. Same problem happens with http and ftp but not with ping. A ping out from the server actually solves the connectivity issues instantly, though inexplicably. In retrospect my original post seems more apt in the linux-networking forum.
 
Old 04-15-2009, 02:12 AM   #9
souljahladze
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
This is also sometimes connected with storage. I had full fs and it caused problems as you specified. So check your free space on HDD especially partition with OS and also SWAP part is important let me know if it helped.
 
Old 04-16-2009, 09:23 PM   #10
donnoit
LQ Newbie
 
Registered: Aug 2007
Posts: 9

Original Poster
Rep: Reputation: 0
In my case, ultimately the cause was an IP address conflict. My sshd was running on a virtual machine (running ubuntu). By mistake a Network Admin had doled out an IP address to my virtual machine which has already been pre-allocated to another (non-virtual) machine. Somehow a ping to my virtual machine would "clear a path" for the ssh-client (also on the pinger machine) to reach the SSHD server on my virtual machine. This would last temporarily, until perhaps one of two things happened (I'm not sure which): either the original owner of the IP address "reclaimed its IP address" or this "ssh-client" lost memory of the path to the SSHD on the virtual machine.

Hope this helps anyone else who may encounter this weird situation.

Last edited by donnoit; 04-16-2009 at 09:24 PM.
 
  


Reply

Tags
openssh


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
SSH "Connection Refused" problem when there is no firewall/router involved in Fedora4 d2army Linux - Networking 5 10-04-2005 05:01 PM
ircd.conf: "Connection failed. Error: Connection refused" hamish Linux - Software 3 03-10-2005 07:23 AM
SSH PuTTy gives "connection refused" Sathington Linux - Networking 5 03-18-2004 05:10 AM
What is "Xlib: connection to ":0.0" refused by server " rack201 Linux - Software 1 02-04-2004 07:49 AM
lp filename yields "cannot open connection to localhost - Connection refused" jjge Linux - General 3 12-28-2003 11:02 PM


All times are GMT -5. The time now is 02:10 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration