site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
636
Share Topic
Posting?
Post a:
Post a:
Links: ·Forum FAQ ·Attitude Adjustment ·Linux docs ·DistroWatch ·OPLM ·FreeBSD Handbook
AuthorAll Replies


laura
Domestic Bliss
Premium
join:2002-04-16
San Jose, CA

sudo and PATH

I know that in SUSE, when I use sudo it uses my PATH by default and not roots path. Is there a way to make it use root's path? or at least add something to the PATH? I've looked at /etc/sudoers but I'm not sure what to add there or if it's even possible.
--
43 things

Bryan001
Premium
join:2002-08-17
Saint Louis, MO

Off the top of my head the only thing I got is
sudo su - -c "command"



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:14

reply to laura
See the -s flag, compared to -i.



laura
Domestic Bliss
Premium
join:2002-04-16
San Jose, CA

reply to Bryan001

said by Bryan001:

Off the top of my head the only thing I got is
sudo su - -c "command"
thank you that worked well.
--
43 things


yock
TFTC
Premium
join:2000-11-21
Miamisburg, OH
kudos:3

reply to laura
The extra dash in...

sudo - -c "command"

...indicates that sudo should source root's profile. Among other things, that'll get you /sbin and the like in $PATH. You could always reference the full path of the command if you don't need everything else that comes with root's profile.
--
Have more fun with your GPS.
Geocaching.com


Saturday, 02-Jun 18:35:31 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 12.5 years online © 1999-2012 dslreports.com.
Most commented news this week
Hot Topics