neb/tools/setup/20-ssh-authorized-keys.sh
2023-10-20 00:10:39 +02:00

12 lines
No EOL
396 B
Bash

#!/bin/sh
if ! [ -f "/root/.ssh/authorized_keys" ]; then
echo "importing authorized_keys..."
mkdir -p /root/.ssh
cp /etc/ixvd/secrets/ssh/authorized_keys /root/.ssh/authorized_keys
else
if ! grep -q "# IXVD keys" /root/.ssh/authorized_keys; then
echo "importing authorized_keys..."
cat /etc/ixvd/secrets/ssh/authorized_keys >> /root/.ssh/authorized_keys
fi
fi