Shutdown without sudo user password in ubuntu

Run visudo and add %users ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot

So you can run sudo poweroff or sudo reboot without enter the user password.