fickit: save ssh keys between reboots

This commit is contained in:
nemunaire 2020-01-30 19:02:19 +01:00
commit 0c8bc261d9
3 changed files with 25 additions and 1 deletions

16
configs/sshd-setup.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
[ -f /var/lib/fic/ssh/sshd_config ] && exit 0
mkdir -p /var/lib/fic/ssh/
cp /containers/services/sshd/lower/etc/ssh/* /var/lib/fic/ssh/
mount -o bind /dev /containers/services/sshd/lower/dev
mount -o bind /proc /containers/services/sshd/lower/proc
mount -o bind /sys /containers/services/sshd/lower/sys
mount -o bind /var/lib/fic/ssh/ /containers/services/sshd/lower/etc/ssh
chroot /containers/services/sshd/lower/ ssh-keygen -A
umount /containers/services/sshd/lower/dev /containers/services/sshd/lower/proc /containers/services/sshd/lower/sys /containers/services/sshd/lower/etc/ssh