Question
SSH disconnects itself
Greetings and good morning.
I have a DROPLET under CentOS 8 and it is working very well. So far I have been able to install Apache and PHP, but I have a bug with SSH. When I connect through SSH it does well, but after a few seconds it automatically disconnects which forces me to connect again. This happens to me with several SSH clients and I have tried it from different computers and the error is always the same: it disconnects automatically after several seconds.
I ask for the necessary support to be able to solve this problem. Thank you very much,
Edward Ocando
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
If you using Putty as ssh client application do the below steps to increase keep-alive time interval. It may rectify your time out error.
Click on Connection Type 120 into “Seconds between keepalives”
Moreover, run ssh connection in debug mode, maybe you’ll get additional info. Also, do the following changes at the server end.
/etc/ssh/ssh_config ServerAliveInterval 60 ServerAliveCountMax 120
Additionally, add a rule in ssh service and in the firewall that to accept SSH request from known IP address of your networks.