1

On my rpi machine

pi@pi2 ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.9 (stretch)
Release:        9.9
Codename:       stretch

I observe in my logs that ssh.service keeps restarting over and over.

sudo journalctl -f
Jul 15 17:05:20 pi2 systemd[1]: ssh.service: Start operation timed out. Terminating.                
Jul 15 17:05:20 pi2 sshd[6396]: Received signal 15; terminating.                                    
Jul 15 17:05:20 pi2 systemd[1]: Failed to start OpenBSD Secure Shell server.                        
Jul 15 17:05:20 pi2 systemd[1]: ssh.service: Unit entered failed state.
Jul 15 17:05:20 pi2 systemd[1]: ssh.service: Failed with result 'timeout'.
Jul 15 17:05:20 pi2 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Jul 15 17:05:20 pi2 systemd[1]: Stopped OpenBSD Secure Shell server.
Jul 15 17:05:20 pi2 systemd[1]: Starting OpenBSD Secure Shell server...
Jul 15 17:05:20 pi2 sshd[6399]: Server listening on 0.0.0.0 port 22.
Jul 15 17:05:20 pi2 sshd[6399]: Server listening on :: port 22.
Jul 15 17:06:06 pi2 sshd[5532]: Received disconnect from 192.168.178.23: 11: disconnected by user
Jul 15 17:06:08 pi2 sshd[6403]: Did not receive identification string from 192.168.178.23
Jul 15 17:06:09 pi2 sshd[6404]: Accepted publickey for ibqn from 192.168.178.23 port 52626 ssh2
Jul 15 17:06:51 pi2 systemd[1]: ssh.service: Start operation timed out. Terminating.
Jul 15 17:06:51 pi2 sshd[6399]: Received signal 15; terminating.
Jul 15 17:06:51 pi2 systemd[1]: Failed to start OpenBSD Secure Shell server.
Jul 15 17:06:51 pi2 systemd[1]: ssh.service: Unit entered failed state.
Jul 15 17:06:51 pi2 systemd[1]: ssh.service: Failed with result 'timeout'.
Jul 15 17:06:51 pi2 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Jul 15 17:06:51 pi2 systemd[1]: Stopped OpenBSD Secure Shell server.
Jul 15 17:06:51 pi2 systemd[1]: Starting OpenBSD Secure Shell server...
Jul 15 17:06:51 pi2 sshd[6432]: Server listening on 0.0.0.0 port 22.
Jul 15 17:06:51 pi2 sshd[6432]: Server listening on :: port 22.

It seems to me that systemd does not get notified that sshd is running properly and restarts it again... Do you have any ideas who to resolve this issue?

pi@pi2 ~ $ sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: activating (start) since Mon 2019-07-15 17:24:57 CEST; 1min 4s ago
  Process: 6737 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 6739 (sshd)
    Tasks: 7 (limit: 4915)
   CGroup: /system.slice/ssh.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.