u
This commit is contained in:
@@ -24,7 +24,7 @@ sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash|g" /etc/passwd
|
||||
|
||||
echo "=== Allow the new user [[$NewUser]] to sudo without password? [y] for yes, [anything else] for no"
|
||||
read -p ">>> " AllowSudo
|
||||
if [ "$AllowSudo" == "y" ]
|
||||
if [ "$AllowSudo" = "y" ]
|
||||
then
|
||||
#usermod -a -G sudo $NewUser # Add to sudo group # Option 1: add user to %sudo group
|
||||
echo "$NewUser ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/${NewUser//./-} # Option 2: add a user file into /etc/sudoers.d/
|
||||
|
||||
Reference in New Issue
Block a user