sudo and PATH?

Derek Broughton news at pointerstop.ca
Sun Jan 7 02:03:10 UTC 2007


Peter Garrett wrote:

> On Fri, 05 Jan 2007 15:35:30 -0400
> Derek Broughton <news at pointerstop.ca> wrote:
> 
>> Brian Fahrlander wrote:
>> 
>> > Matt Price wrote:
>> >> 
>> >> I have my regular user's path set to:
>> >> $PATH:/usr/local/scripts/
>> >> 
>> >> but this of course doesn't extend over to sudo  Is there a way to
>> >> change sudo's path, preferably permanently and for every user?
>> > 
>> >     Wouldn't you just add this path to _root_'s path?
>> 
>> Sure, but where is that set... You could do it in root's .bash* scripts,
>> but better here:
>> 
>> derek at othello:~$ egrep "^ENV_\w*PATH" /etc/login.defs
>> ENV_SUPATH \
>>
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
>> ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> 
> Would it not be easier simply to move/link the scripts to /usr/local/bin ,
> which is in the default path? Or have I missed something glaringly
> obvious?

Spoilsport :-)  Yes.  I have never added a directory to the default paths,
because I always just create links from directories already in the path. 
But I can imagine a situation where you might want to have a directory full
of local scripts - of course, I'm not sure why that _wouldn't_
be /usr/local/bin...
-- 
derek





More information about the ubuntu-users mailing list