Ssh – Debian won’t start SSH on startup

debian-jessiessh

I had some trouble with my virtual machine's network interfaces today so had to make some alterations to my interfaces file. Since I have done this, when I boot into my Debian 8.6 VM I receive the error that OpenBSD Secure Shell server failed to start.

[FAILED] Failed to start OpenBSD Secure Shell server.
See `systemctl status ssh.service` for details.

Running sudo systemctl status ssh.service gives the following status output:

ssh.service - Open BSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: failed (Result: start-limit) since Sat 2016-09-17 23:53:44 BST; 4min 37s ago
Process: 824 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Main PID: 824 (code=exited, status=255)

ssh.service: main process exited, code=exited, status=255/n/a
Unit ssh.service entered failed state
ssh.service start request repeated too quickly, refusing to start.
Failed to start OpenBSD Secure Shell server.
Unit ssh.service entered failed state.

Anyone have a clue what could be causing this?

Although I don't see anything wrong with it, my network/interfaces file is:

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.200
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255

Best Answer

Common causes for SSHD refusing to (re)start are configuration errors. Check with:

$ /usr/sbin/sshd -T