I'm running some scripts to check the UFW status and would like to run sudo ufw status without having to do sudo. I was hoping to find a firewall or ufw group to add myself to, but I didn't find any.
How can I allow any user X to do the ufw status without being root or asking for sudo password?
UPDATE:
I wanted to try to add my own file to /etc/sudoers.d/, but was lazy so decided to copy one already existing, like this:
sudo cp /etc/sudoers.d/mintupdate /etc/sudoers.d/firewall_status
Don't do That! You will not be able to do sudo or login again. I had to do a boot recovery. Instead use:
sudo visudo -f /etc/sudoers.d/ufwstatus
Now just follow the accepted answer below.