Ubuntu Debian Mint Linux SSHD OpenSSH Server Not Starting After Reboot Solution

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.


Tags:

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,

Latest Articles

  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -
  • Ubuntu Debian How To Install Recommended Packages Automatically
  • How to set Linux Ubuntu Redhat Debian Command Line http https socks proxy for yum apt