kexec-installer: also support authorized_keys2

This commit is contained in:
Jörg Thalheim 2022-11-25 10:13:32 +01:00
parent 65227bf951
commit 483c55c0ab

View file

@ -19,10 +19,13 @@
pwd
mkdir -p initrd/ssh
pushd initrd
if [ -e /root/.ssh/authorized_keys ]; then
# workaround for debian shenanigans
grep -o '\(ssh-[^ ]* .*\)' /root/.ssh/authorized_keys >> ssh/authorized_keys
fi
for key in /root/.ssh/authorized_keys /root/.ssh/authorized_keys2; do
if [ -e "$key" ]; then
# workaround for debian shenanigans
grep -o '\(ssh-[^ ]* .*\)' "$key" >> ssh/authorized_keys
fi
done
# Typically for NixOS
if [ -e /etc/ssh/authorized_keys.d/root ]; then
cat /etc/ssh/authorized_keys.d/root >> ssh/authorized_keys
fi