-   Linux - Newbie (
-   -   Giving regular users access to certain root-only commands (

slickrcbd 12-22-2003 09:01 PM

Giving regular users access to certain root-only commands
Is there any way I can give EVERYBODY access to certain root-only commands without giving out the su password?

Specifically, I'd like for people to be able to turn off the computer when their finished with the shutdown -h or the halt command, and I'd like for people to mount CDs, 3.5" floppy, and ZIP disks, which I only know how to do using the mount command. Also the reboot command would be nice to add to the list so people can switch OSes (I have a duel boot and linux is NOT the primary OS for some users). Finally, I'd like for at least one user to be able to use the ifconfig command, or have some other means of finding out what the current IP number of the computer is, since it's allocated via DHCP.

Unfortunetly, all of these tasks require me to be logged in as root (or use the su command), and nobody else can accomplish these tasks except for those with the su password. I am quite inexperienced with Linux/Unix administration and am still learning, so if somebody could please give a detailed explination of the procedure involved in making these commands available to everybody, I'd apreciate it.

Oh, BTW, I'm using Yellow Dog Linux 2.1 on a PowerMac 6500/300. It's basically a PPC version of Red Hat Linux, though I noticed a few differences in my limited experience with Red Hat. I'd use something later, but I can't seem to get later distrubutions to run on that hardware.

MasterC 12-22-2003 09:19 PM

There are going to be a few options for this:

1. Check out the man page for sudo. This is probably going to be the best option, I consider it the "proper" way to do such tasks, and it's also going to be the best documented.

2. Create a group. Now, own these specific tasks to that group. Add your users to this group, and ensure proper permissions for GROUP are given. Finally, you may have to modify your user's PATH variables to include the /sbin directory as that's where quite a few of these "root" commands will be located. Each time you add additional users, be sure to add them to this group (assuming you want them to have the same permissions).

There are others, however these 2 are probably going to be some of your better choices. If you aren't in a hurry, hold out for a few other responses to get a good feel for some ideas to choose from.


Demonbane 12-22-2003 09:49 PM

Also depending on the distro, all these groups might already been setup for you, take a look at /etc/group file.

MasterC 12-24-2003 02:51 AM

Good point! :) On a few distros, they have chosen the group "wheel" for these functions.


jdruin 12-24-2003 07:27 AM

Doesnt the group "wheel" give sudoers total control and not just limit them to certain commands? or is there something else you do to prevent this?

All times are GMT -5. The time now is 01:03 PM.