[netboot] add ssh keys

This commit is contained in:
Nico Schottelius 2019-12-09 19:57:57 +01:00
parent be9616a17f
commit 5e5e37a7d7

View file

@ -5,10 +5,12 @@
date=$(date +%F)
suite=ascii
dir=${suit}-${date}
dir=${suite}-${date}
kernel=${dir}-kernel
keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/master/files
debootstrap "${suite}" "${dir}"
chroot ${dir} apt install -y openssh-server rdnssd
chroot ${dir} apt install -y openssh-server rdnssd linux-image-amd64
cat > ${dir}/etc/network/interfaces << EOF
auto lo
@ -17,3 +19,13 @@ iface lo inet loopback
auto eth0
iface eth0 inet6 auto
EOF
mv ${dir}/boot/vmlinuz-* ${kernel}
rm ${dir}/boot/initrd*
mkdir -p ${dir}/root/.ssh
for key in balazs dominique jinguk nico; do
curl -s ${keyurl}/${key}.pub >> ${dir}/root/.ssh/authorized_keys
done
( cd ${dir} ; find . | cpio -H newc -o | gzip -9 > ../${dir}-initramfs )