Giving a user (not a root) an access to some system commands
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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??
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.