From 7f6f8cc3650260b5f6d9cc961cd07bab0910fafa Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 2 Aug 2025 14:06:37 +0200 Subject: [PATCH] debian: Fix SSH key setup --- debian/debian-secure.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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