If you get error messages like this it is usually because /var/run/sshd does not exist.
root@userbox:/# service sshd status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
Active: failed (Result: start-limit-hit) since Wed 2019-04-10 02:24:44 EDT; 1
Process: 511 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)
Warning: Journal has been rotated since unit was started. Log output is incomple
root@userbox:/# service sshd start
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
May 16 11:45:16userbox systemd[1]: ssh.service: Control process exited, code=exited status=255
May 16 11:45:16userbox systemd[1]: Failed to start OpenBSD Secure Shell server.
May 16 11:45:16userbox systemd[1]: ssh.service: Unit entered failed state.
May 16 11:45:16userbox systemd[1]: ssh.service: Failed with result 'exit-code'.
May 16 11:45:16userbox systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
May 16 11:45:16userbox systemd[1]: Stopped OpenBSD Secure Shell server.
May 16 11:45:16userbox systemd[1]: ssh.service: Start request repeated too quickly.
May 16 11:45:16userbox systemd[1]: Failed to start OpenBSD Secure Shell server.
May 16 11:45:16userbox systemd[1]: ssh.service: Unit entered failed state.
May 16 11:45:16userbox systemd[1]: ssh.service: Failed with result 'start-limit-hit'.
This is a hack but is the simplest fix to this bug:
echo "mkdir -p /var/run/sshd" >> /etc/rc.local
*Double check rc.local to make sure the "exit 0" is at the end, otherwise the above won't work since it would not be executed.
*Also make sure that you have enabled the "rc-local service":
If the rc-local service is not enabled then the command above will not be executed since rc.local would not be used on startup without it being enabled with the command below.
systemctl enable rc-local
Basically we just need to create /var/run/sshd and restart SSHD and it will be good and SSH will start once again.
ubuntu, debian, mint, linux, sshd, openssh, server, reboot, solutionif, var, userbox, ssh, openbsd, shell, lib, systemd, enabled, vendor, preset, enab, active, wed, edt, execstartpre, usr, sbin, exited, rotated, output, incomple, quot, systemctl, journalctl, xe, scheduling, restart, repeated, hack, simplest, echo, mkdir, etc, rc,