Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 09-28-2010, 01:40 PM   #1
LQ Newbie
Registered: May 2010
Location: Hyderabad
Distribution: RHEL
Posts: 12

Rep: Reputation: 0
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.

Last edited by sridhar.bodike; 09-28-2010 at 02:37 PM.
Old 09-28-2010, 01:47 PM   #2
Registered: Jul 2010
Posts: 454

Rep: Reputation: 47
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.
Old 09-28-2010, 01:53 PM   #3
Registered: Mar 2009
Location: Bangalore, India
Distribution: CentOS6.5, CentOS7, Ubuntu14.04
Posts: 182

Rep: Reputation: 29
#PATH=$PATH:/sbin should work.
Old 09-29-2010, 01:37 AM   #4
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,153
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
That's what sudo is all about!!
Old 09-29-2010, 01:44 AM   #5
Senior Member
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Type the following commands in a terminal:

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
SUDO question jason.rohde Linux - Security 2 02-03-2009 04:11 PM
LXer: sudo, or not sudo: that is the question LXer Syndicated Linux News 0 02-07-2008 06:40 PM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
sudo question satimis Linux - Software 3 12-07-2004 09:47 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration