OxDEAD Unicornz

Have you ever seen so many?

Ubuntu 14.04 Ssh init.d Script Broken

Wasted lot of time today trying to figure out why ssh on some server still allows to log in with password despite the fact that in /etc/ssh/sshd_config password based log in is disabled:

1
PasswordAuthentication no

Since the configuration is managed by Puppet I was expecting it restarts service as well. To my surprise pid file of sshd process was pretty old – Puppet, in fact, was unable to restart sshd:

1
2
3
4
5
# puppet agent --debug --test
...
Error: Could not start Service[sshd]: Execution of '/etc/init.d/ssh start' returned 1: 
Error: /Stage[main]/Sshd/Service[sshd]/ensure: change from stopped to running failed: Could not start Service[sshd]: Execution of '/etc/init.d/ssh start' returned 1:
...

It appears that Puppet tried to use init.d script. I’ve found a bug submitted to launchpad – init.d ssh script is broken in Ubuntu 14.04.

1
2
# dpkg -l | grep openssh-server
ii  openssh-server                      1:6.6p1-2ubuntu2                    amd64        secure shell (SSH) server, for secure access from remote machines

Please be informed and use ‘service’ command instead:

1
# service ssh restart