Update add key section

This commit is contained in:
Ceres 2025-10-14 15:08:39 +01:00
parent a99b8e534f
commit 63eb5d9df4

View file

@ -39,7 +39,7 @@ done
#Add users public key #Add users public key
while true; do while true; do
read -p "The path to the user's pubkey?:" key read -p "The user's pubkey?:" key
if ! [ "$key" = '' ];then break;fi if ! [ "$key" = '' ];then break;fi
echo "Must set a pubkey." echo "Must set a pubkey."
done done
@ -106,7 +106,7 @@ fi
if [ "$dokey" = 'y' ]; then if [ "$dokey" = 'y' ]; then
echo "Adding pubkey..." echo "Adding pubkey..."
install -dm700 "/home/$name/.ssh" install -dm700 "/home/$name/.ssh"
cat "$key" >> "/home/$name/.ssh/authorized_keys" echo "$key" >> "/home/$name/.ssh/authorized_keys"
chmod 600 "/home/$name/.ssh/authorized_keys" chmod 600 "/home/$name/.ssh/authorized_keys"
echo "Making user owner of authorized_keys..." echo "Making user owner of authorized_keys..."
chown -R "$name:$name" "/home/$name" chown -R "$name:$name" "/home/$name"