-   Linux - Newbie (
-   -   Giving a user (not a root) an access to some system commands (

asschay 09-08-2005 02:42 AM

Giving a user (not a root) an access to some system commands

I need to set up a user, say test, in a group that have access to some of the administration that can only be done if I log in as a root.

I need to give the user test an access to reboot, shutdown, and kill some running processes.

I tried making a new user and make 'uucp' as its primary group, but that doesn't work, I also tried making it as root group, but that still gives me no joy.

Is this task even possible at all for a user that's not a super user like root??

Thank you so much


teebones 09-08-2005 02:55 AM


You could use "sudo" for this.

asschay 09-08-2005 10:49 AM

won't i need to supply the user with root/superuser passwor with command sudo?

I am trying to give limited access to the user but now the user can't even shutdown or reboot anymore..


tuxrules 09-08-2005 11:09 AM

You would have to make specific entries (what specific commands you want which user to be able to control) in sudo configuration using visudo command. visudo is kinda special vi editor for sudo utility.

# visudo

Please read the sudo tutorial or how-tos on the net...also man sudo for more info.

And yes, you would not have to give superuser password once you set sudo. After setup, you can simply say

$ sudo shutdown -h now

as a regular user.


asschay 09-08-2005 01:21 PM

now I got it

last question though, is there a way to execute that reboot or shutdown commands, as a user, without typing up the 'sudo'. Make those commands to know that sudo is needed before executing them.

Thank you so much, I appreciate your help


XavierP 09-08-2005 01:35 PM

You could look into "alias", making shutdown -h now and alias for sudo shutdown -h now. Not sure how this would work and could potentially screw with the command for everyone.

If you have a test box, try it out.

fiservguy 09-08-2005 03:06 PM

You could use a non-Linux keyword for the alias. For instance,

alias reboot="shutdown -h now"

XavierP 09-08-2005 05:06 PM

Except "reboot" is a command. I'd use "alias down="sudo shutdown -n now""

asschay 09-08-2005 05:53 PM

Hi guys,

Solution to my own questions:

editing the file '/etc/sudoers', give the user name access to certain commands, and making alias for those commands, so sudo is not needed.

and giving alias to reboot and shutdown doesn't screw anything for me

Thank you guyss..


All times are GMT -5. The time now is 09:46 AM.