Upstart script for Dropbear SSH server

A very sleak upstart job script for dropbear.

I’ve replaced the classic OpenSSH server with Dropbear: it’s basically the same speed, lot less on memory and I don’t use most of the functions of OpenSSH.

Since I’m on Ubuntu 12.04, the elengant way would be to use Upstart ( also, the respawn is very useful ), so here is my script in /etc/init/dropbear.conf:

description "Dropbear SSH server"
author "Peter Molnar <hello>"

start on filesystem or runlevel [2345]
stop on runlevel [!2345]

respawn limit 10 5
umask 022

env DROPBEAR_RSAKEY=/etc/dropbear/dropbear_rsa_host_key
env DROPBEAR_DSSKEY=/etc/dropbear/dropbear_dss_host_key

pre-start script
        test -x /usr/sbin/dropbear || { stop; exit 1; }
end script

expect daemon


Encourage creation!

If this entry helped you, or you simply liked it, leave a tip via
Monzo (only in the UK or via Google Pay) or Paypal