Server unexpectedly closed network connection (sftp + putty)

5,809

Most likely you have a wrong configuration of the IP Addresses, you might double check that especially if these are not DHCP assigned.

Share:
5,809

Related videos on Youtube

Hi-Tech
Author by

Hi-Tech

Updated on September 18, 2022

Comments

  • Hi-Tech
    Hi-Tech over 1 year

    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?

    • krisFR
      krisFR almost 9 years
      I am running CloudLinux 6.6 with Cpanel/WHM not sure if it is off-topic or not in that case (off-topic : working with a service provider's management interface, such as cPanel)...
    • pcnate
      pcnate almost 9 years
      Is the user able to do anything for the minute that they are connected?
    • Hi-Tech
      Hi-Tech almost 9 years
      thanks pcnate for your reply, the user is instantly disconnected at random. I believe the issue to be that the Cloud Linux license was migrated to a different IP. I discovered it after trying to run a yum-update which failed with 'IP xx.xx.xx.xxx Not Licensed'.
  • Hi-Tech
    Hi-Tech almost 9 years
    I discovered that the Cloud Linux license was bound to an alternate IP address. In other words, my boss moved the license to another server without informing me, thus, connection problems instantly ensued.