From a66fdb7bd4f3ce95a01ac5326220320410ddedea Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Tue, 11 Feb 2025 18:17:17 +0100 Subject: [PATCH] Update alpine/alpine-secure.sh --- alpine/alpine-secure.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alpine/alpine-secure.sh b/alpine/alpine-secure.sh index 865dbe6..2918f58 100644 --- a/alpine/alpine-secure.sh +++ b/alpine/alpine-secure.sh @@ -7,7 +7,8 @@ apk add wireguard-tools echo "Setting up user..." -adduser -s /bin/bash -D $USERNAME +setup-user -u $USERNAME + echo "Configuring WireGuard..." WG_SUBNET="fc$(openssl rand -hex 1):$(openssl rand -hex 2):$(openssl rand -hex 2):$(openssl rand -hex 2)" @@ -30,6 +31,7 @@ ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.vmh-ssh-vpn rc-update add wg-quick.vmh-ssh-vpn default rc-service wg-quick.vmh-ssh-vpn start + echo "Configuring ssh..." mkdir /home/$USERNAME/.ssh echo $MY_SSH_KEY > /home/$USERNAME/.ssh/authorized_keys @@ -47,6 +49,7 @@ echo "rc_before=sshd" > /etc/conf.d/wg-quick.vmh-ssh-vpn rc-service sshd restart + echo "Configuring sudo..." cat < /etc/sudoers.d/99-vmh-newuser $USERNAME ALL=(ALL:ALL) NOPASSWD:ALL