Disallow sudo without password

This commit is contained in:
Manuel Thalmann 2023-04-04 23:43:56 +02:00
parent b246d1bd22
commit 555c2eb3b7

View file

@ -3,5 +3,6 @@ if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE";
else
sed -i "s/^# \(%wheel \)/\1/" /etc/sudoers;
wheelPattern="^# \(%wheel \)";
sed -i "/$wheelPattern/{ /NOPASSWD/{ b; }; s/$wheelPattern/\1/; }" /etc/sudoers;
fi;