neb/tools/setup/20-ssh-authorized-keys.sh

12 lines
396 B
Bash
Raw Normal View History

2023-10-20 00:10:39 +02:00
#!/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