summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-08-31 21:28:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-08-31 22:39:58 +0200
commitbb16d1f1bf210d0ac6f92fa5601a60e3639cbfb9 (patch)
tree5460a305e57851cb62a21ed702b82275586005b8 /services
parentf39aba8aa382eecc0021485e03760e6713558fc8 (diff)
Add service files for OpenSSH server
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'services')
-rw-r--r--services/Makemodule.am1
-rw-r--r--services/sshd.in5
-rw-r--r--services/sshd_keygen.in14
3 files changed, 20 insertions, 0 deletions
diff --git a/services/Makemodule.am b/services/Makemodule.am
index 5b12ca4..0843787 100644
--- a/services/Makemodule.am
+++ b/services/Makemodule.am
@@ -8,6 +8,7 @@ init_DATA += services/dhcpcd services/dhcpcdmaster services/unbound
init_DATA += services/dnsmasq services/ifdown services/modules
init_DATA += services/network services/hostapd services/swclock
init_DATA += services/swclocksave services/nft services/sigkill
+init_DATA += services/sshd services/sshd_keygen
if USYSLOGD
init_DATA += services/usyslogd
diff --git a/services/sshd.in b/services/sshd.in
new file mode 100644
index 0000000..a6292bc
--- /dev/null
+++ b/services/sshd.in
@@ -0,0 +1,5 @@
+description "OpenSSH server"
+type respawn limit 5
+target boot
+after network sshd_keygen
+exec "@SBINPATH@/sshd" -D
diff --git a/services/sshd_keygen.in b/services/sshd_keygen.in
new file mode 100644
index 0000000..6425e63
--- /dev/null
+++ b/services/sshd_keygen.in
@@ -0,0 +1,14 @@
+description "OpenSSH server - generate host keys"
+type wait
+target boot
+after network
+tty /dev/null
+exec {
+ mkdir -p "@ETCPATH@/ssh/"
+
+ ssh-keygen -f "@ETCPATH@/ssh/host_rsa_key" -N "" -t rsa
+ ssh-keygen -f "@ETCPATH@/ssh/host_ecdsa_key" -N "" -t ecdsa
+ ssh-keygen -f "@ETCPATH@/ssh/host_ed25519_key" -N "" -t ed25519
+
+ service disable sshd_keygen
+}