I have a VPS running Ubuntu 16.04.5 that's been going for a number of years now with little issue. Today, however, I found I was unable to access the server using SSH, receiving 'connection refused' errors. I accessed the server using my VPS host's serial console service, and traced the issue down to openssh server failing to start. Here's an output of service status
, service start
, and sshd -t
following a fresh reboot:
root@167:/# service ssh status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Fri 2019-01-18 04:56:42 EST; 24min ago
Process: 983 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)
Jan 18 04:56:42 167 systemd[1]: Failed to start OpenBSD Secure Shell server.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Unit entered failed state.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Failed with result 'exit-code'.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Jan 18 04:56:42 167 systemd[1]: Stopped OpenBSD Secure Shell server.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Start request repeated too quickly.
Jan 18 04:56:42 167 systemd[1]: Failed to start OpenBSD Secure Shell server.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Unit entered failed state.
Jan 18 04:56:42 167 systemd[1]: ssh.service: Failed with result 'start-limit-hit'.
root@167:/# service ssh start
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
root@167:/# sshd -t
Missing privilege separation directory: /var/run/sshd
I've attempted some research into this, but nothing that's come up seems to have an actual solution - Just endless cycles of 'I have this problem' with no answers, answers that are outdated, or just generally unhelpful information.
Does anybody have any ideas on what to do next to troubleshoot/resolve this issue? SSH was last working about 12 hours ago when I logged in to run updates and rebooted the server.
UPDATE
Issue was resolved using workaround 1 as provided here: https://askubuntu.com/a/1110843/531533
/var/run
is a link to/run
and/run/sshd
exists, is owned by root and has permissions 755. – Jos Jan 18 '19 at 10:44/var/run/sshd
directory, though I've yet to find anything to give a precise reason as to why or how to correct it.Supposedly, this can be 'temporarily' fixed by creating the folder manually, but I'd have to do this every time the server boots.
– SierraKomodo Jan 18 '19 at 10:49/usr/lib/tmpfiles.d/sshd.conf
in this wayd /run/sshd 0755 root root
. – pa4080 Jan 18 '19 at 10:53