Edit visudo file:
sudo visudo
To run the poweroff command as the user username add the following line:
username ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
Edit visudo file:
sudo visudo
To run the poweroff command as the user username add the following line:
username ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown