regular users using halt
back a few months ago when i was running mandrake 9.1, any user on my computer was able to open a command prompt and issue the halt, reboot, and shutdown commands. after switching to debian, those commands are reserved for the su.
i tried copying "halt" and "reboot" to /usr/bin and changing the permissions (...it made since at the time) but i had no luck. thanks for your help. TimmyP |
Code:
chmod u+s /sbin/halt |
Install the SUDO package. With SUDO you can define which users/groups are allowed to run certain commands (you can specify the commands) with different (for example root) permissions. You can even specifiy whether they have to enter a password when they execute a certain command.
I had the problem that I had to switch to my root account to shutdown my pc. Now I can just type "sudo shutdown -h now" in my user account. Do a Google search on 'sudo' to find more information. |
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 Code:
alias halt="sudo /sbin/halt" 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 |
thank you for your help, i ended up going with the sudo method.
thanx again TimmyP |
All times are GMT -5. The time now is 01:32 AM. |