Fix install docs and deploy keys script

This commit is contained in:
marc
2024-12-24 17:57:40 +01:00
parent d452ec86dd
commit 8da975b098
2 changed files with 14 additions and 1 deletions

View File

@@ -105,7 +105,7 @@ cp ~/.ssh/id_<hostname> /mnt/home/marc/.ssh/id_<hostname>
* Initialization
Steps after reboot
** Set up the user
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root (via vultr dashboard) and set the password for your user:
#+BEGIN_SRC bash
passwd marc
#+END_SRC

View File

@@ -11,7 +11,15 @@ fi
read -p "Username: " USERNAME
PRIVATE_KEY="id_$HOSTNAME"
ENCRYPTED_PRIVATE_KEY="$PRIVATE_KEY.gpg"
PUBLIC_KEY="id_$HOSTNAME.pub"
DECRYPTED=f
if [ ! -f $PRIVATE_KEY ]; then
DECRYPTED=t
echo "Decrypting private key ..."
gpg -d $ENCRYPTED_PRIVATE_KEY > $PRIVATE_KEY
fi
echo "Deploying private key ($PRIVATE_KEY) to ($USERNAME@$HOSTIP) ..."
scp $PRIVATE_KEY $USERNAME@$HOSTIP:.ssh/$PRIVATE_KEY
@@ -19,4 +27,9 @@ scp $PRIVATE_KEY $USERNAME@$HOSTIP:.ssh/$PRIVATE_KEY
echo "Deploying public key ($PUBLIC_KEY) to ($USERNAME@$HOSTIP) ..."
scp $PUBLIC_KEY $USERNAME@$HOSTIP:.ssh/$PUBLIC_KEY
if [ "$DECRYPTED" = 't' ]; then
echo "Deleting decrypted private key ..."
rm $PRIVATE_KEY
fi
echo "Done"