LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to make a normal user execute commands of the super user's .?.. (http://www.linuxquestions.org/questions/linux-server-73/how-to-make-a-normal-user-execute-commands-of-the-super-users-817756/)

siranjeevi 07-03-2010 12:41 AM

How to make a normal user execute commands of the super user's .?..
 
Hi everybody,

I have a question that i want to make a normal user to execute the commands which the root user is able to execute, say if i have a user named siru and when i logged in using siru i cannot run commands like tracert,nmap@loccalhost and all but i can run when i have logged into root account so my question is how to make siru to run the command tracert,nmap@localhost.

I have even edited the .bash_profile of siru's home directory from

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
~

"to"

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/bin:/usr/sbin:/sbin

export PATH
~

but nothing seems to be working. Can anyone help.

Thanks,

druuna 07-03-2010 03:51 AM

Hi,

Changing the content of .bash_profile (the PATH part in your case) will not do the trick.

As a general rule you do not want to give normal users root privileges, but there are cases that a normal user wants to execute one (or a few) "root commands". To make this possible the sudo command was implemented.

Here's a general description of the sudo command: Sudo - Wikipedia

These links will help you set things up and show some examples:
Sudo Setup Guide - linuxhelp
Using sudo - LHN

There are a lot of articles to be found on-line about this topic, so do use your favorite search engine for more information. You don't mention your linux distro, I'm guessing there is one specific for that one, so do include your distro in the search.

Hope this helps.


All times are GMT -5. The time now is 08:48 AM.