kexec-installer: also support authorized_keys2
This commit is contained in:
parent
65227bf951
commit
483c55c0ab
1 changed files with 7 additions and 4 deletions
|
@ -19,10 +19,13 @@
|
||||||
pwd
|
pwd
|
||||||
mkdir -p initrd/ssh
|
mkdir -p initrd/ssh
|
||||||
pushd initrd
|
pushd initrd
|
||||||
if [ -e /root/.ssh/authorized_keys ]; then
|
for key in /root/.ssh/authorized_keys /root/.ssh/authorized_keys2; do
|
||||||
|
if [ -e "$key" ]; then
|
||||||
# workaround for debian shenanigans
|
# workaround for debian shenanigans
|
||||||
grep -o '\(ssh-[^ ]* .*\)' /root/.ssh/authorized_keys >> ssh/authorized_keys
|
grep -o '\(ssh-[^ ]* .*\)' "$key" >> ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
# Typically for NixOS
|
||||||
if [ -e /etc/ssh/authorized_keys.d/root ]; then
|
if [ -e /etc/ssh/authorized_keys.d/root ]; then
|
||||||
cat /etc/ssh/authorized_keys.d/root >> ssh/authorized_keys
|
cat /etc/ssh/authorized_keys.d/root >> ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue