Disallow sudo without password

This commit is contained in:
Manuel Thalmann 2023-04-04 23:43:56 +02:00
parent e32673ef99
commit b1cef3ce12

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;