I am running CloudLinux 6.6 with Cpanel/WHM.
We had disabled default port 22, but a client required it, so ever since I switched back to port 22, we have experienced "Server unexpectedly closed network connection".
This occurs both BEFORE and AFTER authentication.
It occurs with any user account including root.
It occurs with white-listed IP addresses.
The only thing I have found in the logs is this:
/var/log/secure
Jun 1 13:03:01 whm sshd[428651]: Accepted password for myotherusername from 70.88.38.178 port 61683 ssh2
Jun 1 13:03:01 whm sshd[428651]: pam_unix(sshd:session): session opened for user myotherusername by (uid=0)
Jun 1 13:03:01 whm sshd[428655]: subsystem request for sftp
Jun 1 13:04:01 whm pam_lve[428651]: pam_unix(sshd:session): session closed for user myotherusername
There seems to be nothing around that time in /var/log/messages
to correlate.
I have edited /etc/ssh/sshd_config
to include: ClientAliveInterval 60
which made no difference.
For some reason, restarting sshd seems to stop the issue for a while, but its not a fix.
Anyone have any ideas on where I should look next or how to fix once and for good?