1

Getting a lot of error messages trying to fix my ubuntu server not having any internet. In the end, I found out it was due to the gateway pointing to wrong IP. Had to switch gateway to xxx.xxx.x.193 in /etc/network/interfaces

But prior to that, I was reading answer here and followed its commands to see if it would resolve my internet on server.

https://askubuntu.com/questions/767574/no-network-after-upgrade-to-16-04/767944#767944

$ sudo systemctl enable systemd-networkd
$ sudo systemctl enable systemd-resolved
$ sudo systemctl start systemd-resolved
$ sudo rm /etc/resolv.conf
$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
$ sudo vi /etc/systemd/network/20-dhcp.network

After I did that and rebooted, got all sorts of error messages. I am thinking might be related to DHCP being set to auto. But not sure. Any suggestions on fix? Here's errors I am getting in startup messages.

Mar 22 20:04:42 ubuntu sshd[1413]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:42 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:42 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:42 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Mar 22 20:04:42 ubuntu sshd[1528]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:42 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Mar 22 20:04:42 ubuntu dovecot: master: Dovecot v2.2.22 (fe789d2) starting up for imap, pop3 (core dumps disabled)
Mar 22 20:04:42 ubuntu systemd[1]: dovecot.service: PID file /var/run/dovecot/master.pid not readable (yet?) after start: No such file or directory
Mar 22 20:04:42 ubuntu systemd[1]: Started Dovecot IMAP/POP3 email server.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:42 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:42 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Mar 22 20:04:42 ubuntu sshd[1533]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:42 ubuntu sshd[1533]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:42 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:42 ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:43 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:43 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Mar 22 20:04:43 ubuntu sshd[1537]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:43 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:43 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:43 ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Mar 22 20:04:43 ubuntu sshd[1541]: Missing privilege separation directory: /var/run/sshd
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Control process exited, code=exited status=255
Mar 22 20:04:43 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:43 ubuntu systemd[1]: ssh.service: Failed with result 'exit-code'.
Mar 22 20:04:44 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:44 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:44 ubuntu systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:44 ubuntu systemd[1]: Stopped OpenBSD Secure Shell server.
Mar 22 20:04:44 ubuntu systemd[1]: ssh.service: Start request repeated too quickly.
Mar 22 20:04:44 ubuntu systemd[1]: Failed to start OpenBSD Secure Shell server.
Mar 22 20:04:44 ubuntu systemd[1]: ssh.service: Unit entered failed state.
Mar 22 20:04:44 ubuntu systemd[1]: ssh.service: Failed with result 'start-limit-hit'.
Mar 22 20:04:45 ubuntu fail2ban-client[1415]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 146]: option 'port' $
Mar 22 20:04:45 ubuntu named[1441]: using built-in root key for view _default
Mar 22 20:04:45 ubuntu named[1441]: set up managed keys zone for view _default, file 'managed-keys.bind'
Mar 22 20:04:45 ubuntu named[1441]: configuring command channel from '/etc/bind/rndc.key'
Mar 22 20:04:45 ubuntu named[1441]: command channel listening on 127.0.0.1#953
Mar 22 20:04:45 ubuntu named[1441]: configuring command channel from '/etc/bind/rndc.key'
Mar 22 20:04:45 ubuntu named[1441]: command channel listening on ::1#953
Mar 22 20:04:45 ubuntu named[1441]: the working directory is not writable
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:45 ubuntu named[1441]: managed-keys-zone: journal file is out of date: removing journal file
Mar 22 20:04:45 ubuntu named[1441]: unable to remove journal 'managed-keys.bind.jnl': 'Permission denied'
Mar 22 20:04:45 ubuntu named[1441]: managed-keys-zone: loaded serial 5
Mar 22 20:04:45 ubuntu named[1441]: zone 0.in-addr.arpa/IN: loaded serial 1
Mar 22 20:04:45 ubuntu named[1441]: zone localhost/IN: loaded serial 2
Mar 22 20:04:45 ubuntu named[1441]: zone 127.in-addr.arpa/IN: loaded serial 1
Mar 22 20:04:45 ubuntu named[1441]: zone 255.in-addr.arpa/IN: loaded serial 1
Mar 22 20:04:45 ubuntu named[1441]: all zones loaded
Mar 22 20:04:45 ubuntu named[1441]: running
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './DNSKEY/IN': 2001:500:84::b#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './NS/IN': 2001:500:84::b#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './DNSKEY/IN': 2001:500:84::b#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './NS/IN': 2001:500:84::b#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving 'G.ROOT-SERVERS.NET/AAAA/IN': 2001:503:ba3e::2:30#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './DNSKEY/IN': 2001:503:ba3e::2:30#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving 'E.ROOT-SERVERS.NET/AAAA/IN': 2001:503:ba3e::2:30#53
Mar 22 20:04:45 ubuntu named[1441]: network unreachable resolving './NS/IN': 2001:503:ba3e::2:30#53
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:45 ubuntu systemd[1]: Stopped Fail2Ban Service.
Mar 22 20:04:45 ubuntu systemd[1]: Starting Fail2Ban Service...
Mar 22 20:04:45 ubuntu fail2ban-client[1551]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 146]: option 'port' $
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Mar 22 20:04:45 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:45 ubuntu kernel: [   23.839071] audit: type=1400 audit(1553310285.596:10): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" nam$
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:45 ubuntu systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:45 ubuntu systemd[1]: Stopped Fail2Ban Service.
Mar 22 20:04:45 ubuntu systemd[1]: Starting Fail2Ban Service...
Mar 22 20:04:46 ubuntu systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 22 20:04:46 ubuntu named[1441]: network unreachable resolving 'G.ROOT-SERVERS.NET/AAAA/IN': 2001:dc3::35#53
Mar 22 20:04:46 ubuntu fail2ban-client[1559]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 146]: option 'port' $
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Mar 22 20:04:46 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Mar 22 20:04:46 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:46 ubuntu php-fpm7.2[1435]: [22-Mar-2019 20:04:46] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'php_com_do$
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:46 ubuntu systemd[1]: Stopped Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: Starting Fail2Ban Service...
Mar 22 20:04:46 ubuntu mysql[1446]:  * Starting MySQL (Percona Server) database server mysqld
Mar 22 20:04:46 ubuntu fail2ban-client[1569]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 146]: option 'port' $
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Mar 22 20:04:46 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:46 ubuntu kernel: [   24.800151] audit: type=1400 audit(1553310286.560:11): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" nam$
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:46 ubuntu systemd[1]: Stopped Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: Starting Fail2Ban Service...
Mar 22 20:04:46 ubuntu fail2ban-client[1880]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 146]: option 'port' $
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Mar 22 20:04:46 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:46 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 20:04:47 ubuntu kernel: [   25.398516] audit: type=1400 audit(1553310287.156:12): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" nam$
Mar 22 20:04:47 ubuntu systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Mar 22 20:04:47 ubuntu systemd[1]: Stopped Fail2Ban Service.
Mar 22 20:04:47 ubuntu systemd[1]: fail2ban.service: Start request repeated too quickly.
Mar 22 20:04:47 ubuntu systemd[1]: Failed to start Fail2Ban Service.
Mar 22 20:04:47 ubuntu systemd[1]: fail2ban.service: Unit entered failed state.
Mar 22 20:04:47 ubuntu systemd[1]: fail2ban.service: Failed with result 'start-limit-hit'.
1
  • I'm beginning to think it was file I added "/etc/systemd/network/20-dhcp.network" whichmade it use DHCP. I deleted the file. Mar 24, 2019 at 7:13

1 Answer 1

10

I had same problem. The solution was to create the folder /var/run/sshd as root

2
  • 1
    This was my solution too in a DO Droplet with Ubuntu 16 that out of nothing stopped working. Thank you!
    – danielgc
    Oct 12, 2022 at 3:51
  • This helped when trying to start sshd in a PRoot environment (Termux) and I was getting the OP's title error.
    – LoneSpawn
    Jul 4, 2023 at 2:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .