This is a discussion on Where does PATH get set for root user? within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hello, On my system, echo $PATH reveals this for a normal user: /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:. But for root, it's this: /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, On my system, echo $PATH reveals this for a normal user: /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:. But for root, it's this: /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin And since root's path lacks the X11R6 path, I can't execute xterm and some other stuff as root. How can I adjust root's path permanently? /etc/profile sets this, right near the top: PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games" ....so root's path must be getting changed somewhere, or else is not based on /etc/profile. Thanks, Anthony http://nodivisions.com/ |
| |||
| Anthony <orders@nodivisions.com> wrote: > And since root's path lacks the X11R6 path, I can't execute xterm and > some other stuff as root. How can I adjust root's path permanently? You should never ever run X as root, there is not a single reason, login in as user, open some xterm and type 'su -' or use 'sudo'. Good luck -- Michael Heiming Remove +SIGNS and www. if you expect an answer, sorry for inconvenience, but I get tons of SPAM |
| |||
| Anthony <orders@nodivisions.com> wrote: > On my system, echo $PATH reveals this for a normal user: > /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:. > > But for root, it's this: > /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin > > And since root's path lacks the X11R6 path, I can't execute xterm and this is correct and the way it should be. > some other stuff as root. How can I adjust root's path permanently? don't use X as root. period. use su, sudo, kdesu, gnomesu or whatever if you really need to run something that requires X as root. rgds, armin -- my life, my universe, my everything http://www.dtch.org |
| |||
| On 18 Oct 2003 23:41:16 -0700, Anthony <orders@nodivisions.com> wrote: > > > Hello, > > On my system, echo $PATH reveals this for a normal user: > > /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:. > > But for root, it's this: > > /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin > > And since root's path lacks the X11R6 path, I can't execute xterm and > some other stuff as root. How can I adjust root's path permanently? > X is a networking application, and you shouldn't run it as root! > /etc/profile sets this, right near the top: > > PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games" > > ...so root's path must be getting changed somewhere, or else is not > based on /etc/profile. > > Thanks, > Anthony > http://nodivisions.com/ Try ls -al /root -- Alan C Posts with sigs of > 4 lines, or not in plain text, are dumped by my filters. |
| |||
| Alan Connor wrote: > On 18 Oct 2003 23:41:16 -0700, Anthony <orders@nodivisions.com> wrote: > >> >>Hello, >> >>On my system, echo $PATH reveals this for a normal user: >> >>/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:. >> >>But for root, it's this: >> >>/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin >> >>And since root's path lacks the X11R6 path, I can't execute xterm and >>some other stuff as root. How can I adjust root's path permanently? >> > > > X is a networking application, and you shouldn't run it as root! Does this mean that when RedHat lets you log in as root from gdm, that this is supremely dangerous and should be turned off? > > > >>/etc/profile sets this, right near the top: >> >>PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games" >> >>...so root's path must be getting changed somewhere, or else is not >>based on /etc/profile. >> >>Thanks, >>Anthony >>http://nodivisions.com/ > > > Try ls -al /root > |
| |||
| ftoomch <ftoomch@hotmail.com> wrote: > Alan Connor wrote: [..] > > X is a networking application, and you shouldn't run it as root! > Does this mean that when RedHat lets you log in as root from gdm, that > this is supremely dangerous and should be turned off? Yep, however it's a common newbie mistake and we get polluted with questions like this. Once again: There is not a single reason for running X as root, beside silliness. One can use, su, sudo, kdesu/etc. -- Michael Heiming Remove +SIGNS and www. if you expect an answer, sorry for inconvenience, but I get tons of SPAM |
| |||
| There are times when I want to invoke an instance of xterm as root, and without its location in my path, that's a big pain. I'm not "running X as root." Does anyone here actually know the answer to my question? |
| |||
| >Does anyone here actually know the answer to my question? ~root/.bash_profile more text to avoid quote-to-new-text-ratio issue more text to avoid quote-to-new-text-ratio issue more text to avoid quote-to-new-text-ratio issue more text to avoid quote-to-new-text-ratio issue more text to avoid quote-to-new-text-ratio issue more text to avoid quote-to-new-text-ratio issue |
| |||
| 19 Oct 2003 06:41 UTC, Anthony typed: [snip] > /etc/profile sets this, right near the top: > > PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games" > > ...so root's path must be getting changed somewhere, or else is not > based on /etc/profile. It's common for the root path to differ. There may be some sort of modification in /etc/profile, or ~/.profile. And in spite of comments already made, both Debian and Slackware, although modifying roots path do have X11 included. Something along the following lines, placed after existing PATH definition, in /etc/profile would allow you to add to the root path. if [ "`id -u`" = "0" ]; then PATH=/new/path/1:/new/path/2:$PATH fi |
| ||||
| Michael Heiming wrote: > ftoomch <ftoomch@hotmail.com> wrote: > > > >>Alan Connor wrote: > > [..] > >>>X is a networking application, and you shouldn't run it as root! > > >>Does this mean that when RedHat lets you log in as root from gdm, that >>this is supremely dangerous and should be turned off? > > > Yep, however it's a common newbie mistake and we get polluted with > questions like this. Feel free not to answer then. > > Once again: > > There is not a single reason for running X as root, beside silliness. > > One can use, su, sudo, kdesu/etc. > |