sshd: Move hostkeys to /var/lib/ssh

This means keys are persistent even when /etc is not.
This commit is contained in:
Tobias Waldekranz
2023-02-09 10:26:10 +01:00
parent fbd68c4a65
commit 61213c7c3c
6 changed files with 16 additions and 0 deletions
@@ -0,0 +1,2 @@
task [S] /lib/infix/ssh-hostkeys --
service [2345789] <usr/ssh-hostkeys> /usr/sbin/sshd -D -- OpenSSH daemon
+1
View File
@@ -0,0 +1 @@
../available/sshd.conf
+1
View File
@@ -0,0 +1 @@
Include /etc/ssh/sshd_config.d/*.conf
@@ -0,0 +1,3 @@
HostKey /var/lib/ssh/ssh_host_rsa_key
HostKey /var/lib/ssh/ssh_host_ecdsa_key
HostKey /var/lib/ssh/ssh_host_ed25519_key
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
for type in ecdsa ed25519 rsa; do
[ -f /var/lib/ssh/ssh_host_${type}_key ] \
|| ssh-keygen -N "" -t $type -f /var/lib/ssh/ssh_host_${type}_key \
|| exit 1
done
initctl cond set ssh-hostkeys