LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   enable a command that requires root access for a normal user (https://www.linuxquestions.org/questions/linux-general-1/enable-a-command-that-requires-root-access-for-a-normal-user-490481/)

marsguy 10-07-2006 10:17 PM

enable a command that requires root access for a normal user
 
I have 2 questions:

1-If a command is available only for root user, how can I enable it to the normal user as well, In Redhat the command "traceroute" is available for normal users, While in SuSe it is only available for root, So how can I enable it for normal user?

2-Can I create a user who has the full priveleges or the root but with a different name? if yes, how would I do that?

Thanks in advance

zetabill 10-07-2006 10:25 PM

Have you looked into the sudo command? It doesn't change anything, really. It's just a "wrapper" to give administrative priviledges without actually changing any file permissions. Anything other than that could possibly be unsafe.

If you're hell-bent on "cheating" and don't care about security then you could look into the "sticky bit" and adding /sbin and /usr/sbin to the user's path. Even less secure to the point of being dangerous you could just change the permissions of the program itself and ignoring the sticky bit. Again... quite unsafe and you didn't hear that from me... :tisk:

Either way the solution ends up being rather simple.

EDIT: My guilt has made me come back just to tell you to please look into the sudo command before you start changing permissions and sticky bits. There are plenty of solutions with sudo being a great option.

cs-cam 10-08-2006 09:43 AM

traceroute is nothing dangerous and isn't an issue for a user to run. Chances are /usr/sbin and /sbin aren't in the default $PATH for your user, my suggestion is to just add it. That way the user has access to attempt to run all the programs that may be traditionally root-only however if there is something you don't have permission to use, it'll just error out. Using sudo or messing with permissions will allow you to run stuff you potentially shouldn't be.

If you're using bash for your shell (chances are pretty high) just add this to your ~/.bash_profile:
Code:

export PATH="${PATH}:/sbin:/usr/sbin"


All times are GMT -5. The time now is 01:49 AM.