Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Im currently connecting to 2 Linux servers over my remote access VPN via SSH.
Once server is fine, the other keeps disconnecting at random times sometimes after a few seconds idle, sometimes after a few minutes.
Ive run a debug on the SSH daemon and can see it say,
"Read error from host x.x.x.x: Connection reset by peer"
Ive checked the networking on the problematic box but everything appears fine speed/duplex/interface errors.
Are you connecting to these two servers from a Linux box or a Windows box using putty or something similar? I have seen weird behavior before with some servers when not sending KEEPALIVE packets every thirty seconds or so. You can edit the ServerAliveInterval on Linux to accomplish the same thing. Alternatively, take a look at your sshd_config file on the servers and lower ClientAliveInterval. This will send a packet to your client during inactivity. It may take a little tweaking. Also, how are the firewalls on your servers and client configured?
Blue
University of Delaware
Network & Systems Services
Systems Programmer III
Im logging in from a windows box. Typically using putty.
The firewalls between me and the server should be fine since I can connect to other linux servers on the same network without any issues/disconnects.
Its strange as Ive logged onto millions of Linux servers in the past but never has this issue(??).
Ive added a 1 sec Interval to the sshd config so will test this and let you know how it goes.
Is there anything odd in the config that you can see.
Code:
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# This is enabled, PAM authentication is allowed through the
# ChallengeResponseAuthentication and PasswordAuthentication.
#UsePAM no
UsePAM yes
AllowTcpForwarding no
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveCountMax 3
ClientAliveInterval 1
ClientAliveCountMax 10
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
This is very common problem and very difficult to trace. It could be because of internet link, firewall, vpn.
Workaround:
If you are only shell access to server, one easy way to overcome this is use "screen" utility. connection broken when you are doing something, after reconnect just reattach
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.