Update alpine/alpine-secure.sh
This commit is contained in:
parent
0663b8a6b2
commit
a66fdb7bd4
1 changed files with 4 additions and 1 deletions
|
@ -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 <<EOF > /etc/sudoers.d/99-vmh-newuser
|
||||
$USERNAME ALL=(ALL:ALL) NOPASSWD:ALL
|
||||
|
|
Loading…
Add table
Reference in a new issue