Answer the question
In order to leave comments, you need to log in
How to solve the problem, the error "remote side unexpectedly closed network connection" crashes when working through putty via ssh?
There is docker ubuntu 18.04.3 LTS (GNU/Linux 4.2.8 armv71). When connected via putty to the ssh server, 10-15 seconds pass and the error "remote side unexpectedly closed network connection" appears.
I look at the server with the sudo ssh status command, ssh is not working (:
The sudo /etc/init.d/ssh restart command helps
After this command, everything seems to be fine:
If the docker is rebooted, the server works, but after the first connection via ssh everything repeats:- (
Output of #journalctl -u ssh , and its last result:
Dec 29 15:32:46 ubuntu-bionic-armhf-1 systemd[1]: Started OpenBSD Secure Shell server.
Dec 29 15:33:17 ubuntu-bionic- armhf-1 systemd[1]: ssh.service: Main process exited, code=killed, status=9/KILL
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Failed with result 'signal'.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Scheduled restart job, restart counter is at 4.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1 ]: Stopped OpenBSD Secure Shell server.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1]: Starting OpenBSD Secure Shell server...
Dec 29 15:33:17 ubuntu-bionic-armhf-1 sshd[454]: Server listening on 0.0 .0.0 port 2222.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 sshd[454]: Server listening on :: port 2222.
Dec 29 15:33:17 ubuntu-bionic-armhf-1 systemd[1]: Started OpenBSD Secure Shell server.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Main process exited, code=killed, status=9/KILL
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Failed with result 'signal'.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1 ]: Stopped OpenBSD Secure Shell server.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: Starting OpenBSD Secure Shell server...
Dec 29 15:33:49 ubuntu-bionic-armhf-1 sshd[456]: Server listening on 0.0.0.0 port 2222.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 sshd[456]: Server listening on :: port 2222.
Dec 29 15:33:49 ubuntu-bionic-armhf-1 systemd[1]: Started OpenBSD Secure Shell serv
On the advice of @pfg21 I tried the following options in /etc/ssh/sshd_config on the server
TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 360
does not help....
How to solve this problem so that sshd does not crash and works stably. Thank you!
Answer the question
In order to leave comments, you need to log in
Solution:
In sshd.service
$sudo nano /etc/systemd/system/sshd.service
$sudo systemctl daemon-reload
$sudo /etc/init.d/ssh restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question