1
0

add support for configuring root authorized_keys file

This commit is contained in:
2022-09-15 14:30:12 +02:00
parent 3c9aa8f581
commit 289592cbf6
2 changed files with 21 additions and 4 deletions

View File

@@ -2,6 +2,12 @@
mkdir -p /run/sshd
chown root: /root/.ssh/authorized_keys
if [ -n "$ROOT_AUTHORIZED_KEYS" ]; then
if [ -f "$ROOT_AUTHORIZED_KEYS" ]; then
mkdir -p /root/.ssh
cp "$ROOT_AUTHORIZED_KEYS" /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
fi
exec /usr/sbin/sshd -D -e