add users to users group

This commit is contained in:
Arya 2023-01-21 22:29:54 +05:30
parent 804fc1c5e4
commit b6c0ac8e6b
Signed by untrusted user: arya
GPG Key ID: 842D12BDA50DF120

View File

@ -5,6 +5,7 @@ echo "E-Mail of {{username}} is {{email}}."
useradd -Um -s /bin/bash {{username}} useradd -Um -s /bin/bash {{username}}
chmod 711 /home/{{username}} chmod 711 /home/{{username}}
printf "%s\n%s" "${pass}" "${pass}" | passwd {{username}} printf "%s\n%s" "${pass}" "${pass}" | passwd {{username}}
usermod -aG users {{username}}
mkdir /home/{{username}}/.ssh mkdir /home/{{username}}/.ssh
echo "{{sshkey}}" > /home/{{username}}/.ssh/authorized_keys echo "{{sshkey}}" > /home/{{username}}/.ssh/authorized_keys
chmod 700 /home/{{username}}/.ssh chmod 700 /home/{{username}}/.ssh