I need another sudo user on the system, but I need to create a blacklist of the command that this user can't execute
I don't want this user will remove ufw
so I add this line in the sudoers file
username ALL=!/usr/bin/apt-get remove ufw,!/usr/bin/apt-get autoremove
but suddenly I noticed that if I run the command like this in the terminal I will get blocked and it's perfect but then I created a script, and it is not blocking the command in the script.
sudo nano gg.sh
Inside the script:
sudo apt-get remove ufw
and then I will run the script like this
sudo bash gg.sh
It will execute the command regularly.
So is there any way to block specific commands from other sudo users like create a blacklist of command or something smarter way to limit permissions of sudo users.
Or there is a way to fix this issue?