Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
04-30-2012, 10:41 AM
|
#1
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Rep:
|
ssh connection frequently get killed by the remote server
There was no problem to log in the remote computer, which never needed a second try. However, the connection frequently got killed by the remote server, sometime when I logged in for 1 minute, sometime even when I just logged in.
Could any one tell me what or how to locate where the problem is?
|
|
|
04-30-2012, 01:11 PM
|
#2
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
Try setting the following in your /etc/ssh/sshd_config file and restarting SSH on the remote server.
TCPKeepAlive yes
|
|
|
05-01-2012, 05:06 AM
|
#3
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
I tried the suggestion, but that did not help..
Thanks any way.
Quote:
Originally Posted by Kustom42
Try setting the following in your /etc/ssh/sshd_config file and restarting SSH on the remote server.
TCPKeepAlive yes
|
|
|
|
05-01-2012, 10:24 AM
|
#4
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,845
Rep:
|
Is your connection within the same LAN, or does it go over a router to some other LAN? If the latter, is it local or over the internet? Any chance you have two different paths to the same remote computer?
Can you see the connection status in the output of "tcpdump" on both ends at the same time before the connection drops? I am curious if the source port number matches and whether the addresses are translated.
|
|
|
05-01-2012, 09:22 PM
|
#5
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
Thank you so much.
I first ssh a remote pc over internet, this connection never has problem. Then within this ssh, I ssh another pc(192.168.88.5) over LAN, it is local, and the problem occurs. Sorry that I am not familar with network protocol. However, I tried ping 192.168.88.5, and 100% packages are successfully tranmited.
Should I track the problem use "tcpdump"? My remote PC uses UBUNTU, it has tcpdump command.The pc(192.168.88.5) uses CENTOS, and it did have installed tcpdump, however, it is strange that it does not have the tcpdump command but the tcptraceroute command.
Quote:
Originally Posted by Skaperen
Is your connection within the same LAN, or does it go over a router to some other LAN? If the latter, is it local or over the internet? Any chance you have two different paths to the same remote computer?
Can you see the connection status in the output of "tcpdump" on both ends at the same time before the connection drops? I am curious if the source port number matches and whether the addresses are translated.
|
|
|
|
05-01-2012, 09:30 PM
|
#6
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,845
Rep:
|
Quote:
Originally Posted by boubalos
I first ssh a remote pc over internet, this connection never has problem. Then within this ssh, I ssh another pc(192.168.88.5) over LAN,
|
Can you explain what you mean by "within this ssh"? I can think of more than one thing for this, so I need to narrow it down. Can you show both ssh command lines in full?
Quote:
Originally Posted by boubalos
Should I track the problem use "tcpdump"? My remote PC uses UBUNTU, it has tcpdump command.The pc(192.168.88.5) uses CENTOS, and it did have installed tcpdump, however, it is strange that it does not have the tcpdump command but the tcptraceroute command.
|
I don't know if this will be needed, yet, until I know the answer for above.
|
|
|
05-02-2012, 01:03 AM
|
#7
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
first, ssh the remote PC by internet
>ssh 166.111.XX.XXX
after log in, ssh the pc in LAN in the same terminal
>ssh 192.168.88.5
which means the remote PC connects both the internet(by ip 166.111.XX.XXX) and the local LAN (by ip 192.168.88.6). I need to log in the remote PC in order to access the PC in the local LAN(ip is 192.168.88.5)
thanks.
Quote:
Originally Posted by Skaperen
Can you explain what you mean by "within this ssh"? I can think of more than one thing for this, so I need to narrow it down. Can you show both ssh command lines in full?
I don't know if this will be needed, yet, until I know the answer for above.
|
|
|
|
05-02-2012, 09:10 AM
|
#8
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,845
Rep:
|
Quote:
Originally Posted by boubalos
first, ssh the remote PC by internet
>ssh 166.111.XX.XXX
after log in, ssh the pc in LAN in the same terminal
>ssh 192.168.88.5
which means the remote PC connects both the internet(by ip 166.111.XX.XXX) and the local LAN (by ip 192.168.88.6). I need to log in the remote PC in order to access the PC in the local LAN(ip is 192.168.88.5)
|
What you have here are 2 logins. One from host A to host B. One from host B to host C, done from the session started by the previous.
Now which connection is getting killed by which remote?
Last edited by Skaperen; 05-02-2012 at 09:15 AM.
|
|
|
05-02-2012, 10:58 AM
|
#9
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
from host B to host C (i.e. the ssh connection in the LAN)
thank you so much.
Quote:
Originally Posted by Skaperen
What you have here are 2 logins. One from host A to host B. One from host B to host C, done from the session started by the previous.
Now which connection is getting killed by which remote?
|
Last edited by boubalos; 05-02-2012 at 10:59 AM.
|
|
|
05-02-2012, 06:43 PM
|
#10
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,845
Rep:
|
Quote:
Originally Posted by boubalos
from host B to host C (i.e. the ssh connection in the LAN)
thank you so much.
|
So when that connection gets dropped, the connection from A to B is still up, and you can still type commands to host B.
Can you get to the physical console for host B at some point in time to debug from there by trying to connect from B to C there?
|
|
|
05-03-2012, 05:29 AM
|
#11
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by Skaperen
So when that connection gets dropped, the connection from A to B is still up, and you can still type commands to host B.
|
Yes.
Quote:
Originally Posted by Skaperen
Can you get to the physical console for host B at some point in time to debug from there by trying to connect from B to C there?
|
Your suggestion is good, unluckily, I am currently in anther city, so can not access the physical console for host B. I can access the the physical console after a few days, will try the suggestion and report the results.
Thank you so much, Skaperen.
|
|
|
05-03-2012, 11:02 AM
|
#12
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,845
Rep:
|
Can you login as root on C, run screen, and do a tcpdump in the screen session to watch and save the packets ... and likewise on B ... to see what might be causing the connection drop?
|
|
|
05-08-2012, 12:53 AM
|
#13
|
LQ Newbie
Registered: Apr 2012
Location: Beijing
Distribution: Debian, Ubuntu
Posts: 8
Original Poster
Rep:
|
Now, I can access the physical machine of remote PC B. Even I directly use PC B to ssh PC C, the problem occurs. After a few tries, I am sure that the problem is caused by the ssh-client of this PC.
I rebooted the PC, ran Knoppix (which is a live Linux CD), and all problems disappeared.
Thank all of you above.
Quote:
Originally Posted by Skaperen
Can you login as root on C, run screen, and do a tcpdump in the screen session to watch and save the packets ... and likewise on B ... to see what might be causing the connection drop?
|
|
|
|
All times are GMT -5. The time now is 07:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|