This commit is contained in:
陆柯 2022-06-07 22:30:53 +08:00
parent 990219a56e
commit dcce6fcb39
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash|g" /etc/passwd
echo "<<< Allow the new user $NewUser to sudo without password"
#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/
chmod a-w /etc/sudoers.d/$NewUser
chmod a-w /etc/sudoers.d/${NewUser//./-}
echo
# 注意,在这里为新用户创建的配置文件,主人是 root而不是新用户

View File

@ -1,6 +1,6 @@
# https://docs.docker.com/engine/install/debian/
read -p "Choose docker source (a: 阿里云, z: 中科大) >> " DOCKER_SOURCE
read -p "Choose docker source (a: 阿里云, z: 中科大, leave blank for default) >> " DOCKER_SOURCE
if [ $DOCKER_SOURCE = 'a' ]
then
GPG_URL=http://mirrors.aliyun.com/docker-ce/linux/debian/gpg
@ -54,4 +54,4 @@ then
echo " \"$DOCKER_MIRROR\"" | sudo tee -a /etc/docker/daemon.json > /dev/null
echo " ]" | sudo tee -a /etc/docker/daemon.json > /dev/null
echo "}" | sudo tee -a /etc/docker/daemon.json > /dev/null
fi
fi