mirror of
https://github.com/harness/drone.git
synced 2025-05-10 22:21:22 +08:00
feat: [CDE-332]: Sudo no password (#2918)
* feat: [CDE-332]: Sudo no password
This commit is contained in:
parent
abe335ddd2
commit
1b65eb4e04
@ -18,10 +18,12 @@ else
|
|||||||
apt-get update && apt-get install -y adduser
|
apt-get update && apt-get install -y adduser
|
||||||
adduser --disabled-password --home "$homeDir" --gecos "" "$username"
|
adduser --disabled-password --home "$homeDir" --gecos "" "$username"
|
||||||
usermod -aG sudo "$username"
|
usermod -aG sudo "$username"
|
||||||
|
echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora)
|
||||||
useradd -m -d "$homeDir" "$username"
|
useradd -m -d "$homeDir" "$username"
|
||||||
usermod -aG wheel "$username"
|
usermod -aG wheel "$username"
|
||||||
|
echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
;;
|
;;
|
||||||
opensuse)
|
opensuse)
|
||||||
useradd -m -d "$homeDir" "$username"
|
useradd -m -d "$homeDir" "$username"
|
||||||
|
@ -73,4 +73,4 @@ if ! grep -q "^PasswordAuthentication yes" $config_file; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir /var/run/sshd
|
mkdir -p /var/run/sshd
|
Loading…
Reference in New Issue
Block a user