visudo &

Add the bold lines
Defaults        env_reset

Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot, /sbin/poweroff

root    ALL=(ALL) ALL

user_name   ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS


https://help.ubuntu.com/community/Sudoers
posted by citadel