Code: Select all
username ALL:ALL NOPASSWD: ALL
Code: Select all
sudo -u username systemctl hibernate
Code: Select all
username ALL:ALL NOPASSWD: ALL
Code: Select all
sudo -u username systemctl hibernate
This says, if you are "username" then you can sudo anything you like without a password.username ALL:ALL NOPASSWD: ALL
This says, become "username" and then run systemctl as username. If you don't run that as "username" then it will not match the sudo allow so won't do it.. If you _are_ username then it will let you run systemctl as yourself, thus achieving nothing.sudo -u username systemctl hibernate