Setting User ID for /sbin/halt, like ToniT suggests, allows you to shutdown your computer as normal user using the "halt" command (and you can reboot with Ctrl-Alt-Del). But just for the fun of it, here's how to use Sudo to achieve the same thing:
First, you'll probably want to use nano as your system's default text editor. Do "update-alternatives --config editor" and choose nano's number from the list. Then edit ~/.bash_profile and add these two lines:
Code:
EDITOR=nano
export EDITOR
And while you're editing ~/.bash_profile, you can also add some command aliases:
Code:
alias halt="sudo /sbin/halt"
alias reboot="sudo /sbin/reboot"
Then logout and login again so that the changes in ~/.bash_profile take effect.
Next, "su" to root, do "apt-get install sudo" to install the Sudo package, and then type "visudo". Now the /etc/sudoers file should open in nano. Type the following line to the bottom of that file (replace "username" with your username):
Code:
username ALL = (ALL) NOPASSWD: /sbin/halt, /sbin/reboot
Then exit nano saving changes. After doing this you should be able to use the "halt" command as normal user to shutdown computer and the "reboot" command to reboot.