fickit: save ssh keys between reboots
This commit is contained in:
parent
bb9dd10f00
commit
0c8bc261d9
3 changed files with 25 additions and 1 deletions
16
configs/sshd-setup.sh
Normal file
16
configs/sshd-setup.sh
Normal 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
|
||||||
|
|
@ -269,6 +269,10 @@ services:
|
||||||
uts: new
|
uts: new
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
- path: etc/init.d/015-setup-sshd
|
||||||
|
source: configs/sshd-setup.sh
|
||||||
|
mode: "0555"
|
||||||
|
|
||||||
- path: etc/sysctl.d/01-fic.conf
|
- path: etc/sysctl.d/01-fic.conf
|
||||||
source: configs/sysctl-backend.conf
|
source: configs/sysctl-backend.conf
|
||||||
mode: "0444"
|
mode: "0444"
|
||||||
|
|
|
||||||
|
|
@ -209,13 +209,17 @@ services:
|
||||||
ipc: new
|
ipc: new
|
||||||
uts: new
|
uts: new
|
||||||
- name: dns-server
|
- name: dns-server
|
||||||
image: nemunaire/unbound:2c5d3b808517f1ad1cb829a474dec77db0a6513e
|
image: nemunaire/unbound:761b47b640c50d7eff2b6381ee9248957c4d1c3c
|
||||||
binds:
|
binds:
|
||||||
- /etc/unbound/unbound.d:/etc/unbound/unbound.d:ro
|
- /etc/unbound/unbound.d:/etc/unbound/unbound.d:ro
|
||||||
net: /run/netns/nginx
|
net: /run/netns/nginx
|
||||||
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
- path: etc/init.d/015-setup-sshd
|
||||||
|
source: configs/sshd-setup.sh
|
||||||
|
mode: "0555"
|
||||||
|
|
||||||
- path: etc/sysctl.d/01-fic.conf
|
- path: etc/sysctl.d/01-fic.conf
|
||||||
source: configs/sysctl-frontend.conf
|
source: configs/sysctl-frontend.conf
|
||||||
mode: "0444"
|
mode: "0444"
|
||||||
|
|
|
||||||
Reference in a new issue