summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
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
+}