LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to set a user to let him having the read-right as the root? (https://www.linuxquestions.org/questions/linux-software-2/how-to-set-a-user-to-let-him-having-the-read-right-as-the-root-835613/)

thomas2004ch 10-01-2010 07:51 AM

How to set a user to let him having the read-right as the root?
 
Assumed I have user called myUser. How to set this user to have the read-right as the root?

sem007 10-01-2010 08:22 AM

What about sudo ?

With the help of /etc/sudoers file you can give root privileges to non-root users.

Regards,

thomas2004ch 10-01-2010 09:01 AM

Quote:

Originally Posted by sem007 (Post 4114742)
What about sudo ?

With the help of /etc/sudoers file you can give root privileges to non-root users.

Regards,

I know this way. But if I just want to give this user only the privileges for reading and loading (jar file) as root, is it possible?

Regards

djsmiley2k 10-01-2010 09:03 AM

You can use teh sudoers file to set sudo previlidges for only ONE command (or any number of them). Read the man page for sudoers

Code:

man sudoers
This would then allow them to run that command, and ONLY that command, as root :)

to expand on this as the man page is slightly confusing and has just taken me 10min to figure out:

Code:

user ALL=/path/to/command
Will allow 'user' to run the /path/to/command on all systems. If you want this without a password then add: NOPASSWD

Code:

user ALL=NOPASSWD:/path/to/command
Hope this helps!

(P.S. I'd still advise you to read the man page, what if the user rewrites the program to spawn more programs, and their own root shell?)

sem007 10-01-2010 09:40 AM

Quote:

Originally Posted by thomas2004ch (Post 4114777)
I know this way. But if I just want to give this user only the privileges for reading and loading (jar file) as root, is it possible?

Regards

yes you can give root privilege to specific command with help of sudores.

In sudoers file add entry like

Code:

username ALL=/command/full/path
Regards,


All times are GMT -5. The time now is 07:19 PM.