diff --git a/debian/debian-secure.sh b/debian/debian-secure.sh index 067306e..90efee8 100644 --- a/debian/debian-secure.sh +++ b/debian/debian-secure.sh @@ -32,8 +32,10 @@ systemctl enable --now wg-quick@vmh-ssh-vpn echo "Configuring ssh..." -mkdir /home/$USERNAME/.ssh -echo $MY_SSH_KEY > /home/$USERNAME/.ssh/authorized_keys +mkdir -p /home/$USERNAME/.ssh +chown $USERNAME:$USERNAME /home/$USERNAME/.ssh +echo "$MY_SSH_KEY" > /home/$USERNAME/.ssh/authorized_keys +chown $USERNAME:$USERNAME /home/$USERNAME/.ssh/authorized_keys chmod 600 /home/$USERNAME/.ssh/authorized_keys chmod 700 /home/$USERNAME/.ssh