LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-08-2005, 02:42 AM   #1
asschay
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Rep: Reputation: 0
Giving a user (not a root) an access to some system commands


Hi,

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

Aw.
 
Old 09-08-2005, 02:55 AM   #2
teebones
Member
 
Registered: Aug 2005
Location: /home/teebones
Distribution: sometimes this, sometimes that..
Posts: 500

Rep: Reputation: 56
hello,

You could use "sudo" for this.
 
Old 09-08-2005, 10:49 AM   #3
asschay
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
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..

Aw.
 
Old 09-08-2005, 11:09 AM   #4
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 14.1
Posts: 1,141

Rep: Reputation: 55
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.

Tux,
 
Old 09-08-2005, 01:21 PM   #5
asschay
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
aaah....
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

Aw.
 
Old 09-08-2005, 01:35 PM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
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.
 
Old 09-08-2005, 03:06 PM   #7
fiservguy
Member
 
Registered: Nov 2004
Distribution: RHEL 2.1, RHEL 3.0, SUSE 9.2
Posts: 31

Rep: Reputation: 16
You could use a non-Linux keyword for the alias. For instance,

alias reboot="shutdown -h now"
 
Old 09-08-2005, 05:06 PM   #8
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
Except "reboot" is a command. I'd use "alias down="sudo shutdown -n now""
 
Old 09-08-2005, 05:53 PM   #9
asschay
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
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..

Aw.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
giving user access to 'shutdown -r now' or -h commands Lleb_KCir Linux - General 2 03-16-2005 11:50 AM
Giving users access to the system... TCasp77 Slackware 5 02-28-2004 01:18 PM
Giving regular users access to certain root-only commands slickrcbd Linux - Newbie 4 12-24-2003 07:27 AM
About giving ppl root/wheel access unSpawn Linux - General 1 05-20-2001 05:52 PM
About giving ppl root/wheel access unSpawn Linux - Newbie 0 05-20-2001 05:35 PM


All times are GMT -5. The time now is 04:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration