[CentOS] Problem with ssh disconnecting

Tue Feb 13 02:12:53 UTC 2018
Earl Ramirez <earlaramirez at gmail.com>

On Mon, 2018-02-12 at 20:13 -0500, H wrote:
> On 02/12/2018 07:24 PM, Liam O'Toole wrote:
> > On 2018-02-12, H <agents at meddatainc.com> wrote:
> > > Running CentOS 7 on workstation and having a problem with ssh
> > > disconnects. My ssh_config contains:
> > > 
> > > Host *
> > > TCPKeepAlive yes
> > > ServerAliveInterval 30
> > > ServerAliveCountMax 300
> > > 
> > > and sshd_config on the server contains:
> > > 
> > > TCPKeepAlive yes
> > > ClientAliveInterval 60
> > > ClientAliveCountMax 300
> > > 
> > > Have I missed any setting needed to prevent these random
> > > disconnects?
> > > I don't think there is anything wrong with the network card, the
> > > driver, or the cable, since if I am on a VPN connection via
> > > another
> > > server, the VPN and any ssh connection stay up indefinitely.
> > > 
> > > Thanks.
> > 
> > Another poster has provided some possible reasons for the
> > disconnections. Whatever the cause, autossh (from the epel repo) is
> > a
> > good workaround.
> > 
> 
> Not that this happens while I do large scp file transfers that may
> take more than half an hour, simply restarting an ssh session is not
> going to help since I will lose the file transfer.
> 

I don't know if this would help but I had a similar issue and it turned
out that there was a custom script in /etc/profile.d/ that contain
TMOUT 900.

You can also check in /etc/profile, usually, the security logs has
something about the disconnects, of you can use wireshark or a similar
tool to capture and analyse the packets.

-- 
Earl Ramirez <earlaramirez at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20180212/c01fd5eb/attachment-0004.sig>