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..."
|
echo "Setting up user..."
|
||||||
adduser -s /bin/bash -D $USERNAME
|
setup-user -u $USERNAME
|
||||||
|
|
||||||
|
|
||||||
echo "Configuring WireGuard..."
|
echo "Configuring WireGuard..."
|
||||||
WG_SUBNET="fc$(openssl rand -hex 1):$(openssl rand -hex 2):$(openssl rand -hex 2):$(openssl rand -hex 2)"
|
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-update add wg-quick.vmh-ssh-vpn default
|
||||||
rc-service wg-quick.vmh-ssh-vpn start
|
rc-service wg-quick.vmh-ssh-vpn start
|
||||||
|
|
||||||
|
|
||||||
echo "Configuring ssh..."
|
echo "Configuring ssh..."
|
||||||
mkdir /home/$USERNAME/.ssh
|
mkdir /home/$USERNAME/.ssh
|
||||||
echo $MY_SSH_KEY > /home/$USERNAME/.ssh/authorized_keys
|
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
|
rc-service sshd restart
|
||||||
|
|
||||||
|
|
||||||
echo "Configuring sudo..."
|
echo "Configuring sudo..."
|
||||||
cat <<EOF > /etc/sudoers.d/99-vmh-newuser
|
cat <<EOF > /etc/sudoers.d/99-vmh-newuser
|
||||||
$USERNAME ALL=(ALL:ALL) NOPASSWD:ALL
|
$USERNAME ALL=(ALL:ALL) NOPASSWD:ALL
|
||||||
|
|
Loading…
Add table
Reference in a new issue