LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sudo question (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-question-834986/)

sridhar.bodike 09-28-2010 12:40 PM

sudo question
 
when we configure /etc/sudoers file and give a full permissions for a user say sridhar. Now sridhar can run all commands but the drawback is he has to type sudo and give the path of the command to run i.e, for example to run ifconfig command he has to type $sudo /sbin/ifconfig.
Now my doubt is as a normal user i want to execute this command as
$sudo ifconfig now i should get the output.
Now my doubt is that i dont want to give the full path where the command is. similarly i want to run all sudo commands without specifing the full path of the command.
Please can any one help me this issue.

CincinnatiKid 09-28-2010 12:47 PM

You won't necissarily have to type the whole path, such as /sbin/ifconfig, as long as you add /sbin to your user's $PATH environment variable.

basheer 09-28-2010 12:53 PM

#PATH=$PATH:/sbin should work.

prayag_pjs 09-29-2010 12:37 AM

That's what sudo is all about!!

Kenny_Strawn 09-29-2010 12:44 AM

Type the following commands in a terminal:

Code:

sudo /bin/su #Allows you to run the shell as root
/bin/echo "PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/games:$HOME/bin" >> /etc/bash_profile
exit



All times are GMT -5. The time now is 11:28 PM.