Professional Web Applications Themes

Where does PATH get set for root user? - Linux Setup, Configuration & Administration

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/...

  1. #1

    Default Where does PATH get set for root user?

    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 Guest

  2. #2

    Default Re: Where does PATH get set for root user?

    Anthony <com> wrote:
     

    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
    Michael Guest

  3. #3

    Default Re: Where does PATH get set for root user?

    Anthony <com> wrote: 

    this is correct and the way it should be.
     

    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

    armin Guest

  4. #4

    Default Re: Where does PATH get set for root user?

    On 18 Oct 2003 23:41:16 -0700, Anthony <com> wrote: 

    X is a networking application, and you shouldn't run it as root!

     

    Try ls -al /root

    --
    Alan C
    Posts with sigs of > 4 lines, or not in plain text, are dumped by my filters.
    Alan Guest

  5. #5

    Default Re: Where does PATH get set for root user?



    Alan Connor wrote: 
    >
    >
    > X is a networking application, and you shouldn't run it as root![/ref]

    Does this mean that when RedHat lets you log in as root from gdm, that
    this is supremely dangerous and should be turned off?
     
    >
    >
    > Try ls -al /root
    >[/ref]

    ftoomch Guest

  6. #6

    Default Re: Where does PATH get set for root user?

    ftoomch <com> wrote:

     
    [..] [/ref]
     

    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
    Michael Guest

  7. #7

    Default Re: Where does PATH get set for root user?

    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?
    Anthony Guest

  8. #8

    Default Re: Where does PATH get set for root user?

    >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

    Jan Guest

  9. #9

    Default Re: Where does PATH get set for root user?

    19 Oct 2003 06:41 UTC, Anthony typed:
    [snip] 

    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

    Chiefy Guest

  10. #10

    Default Re: Where does PATH get set for root user?



    Michael Heiming wrote: 
    >
    > [..]
    > [/ref]
    >

    >
    >
    > Yep, however it's a common newbie mistake and we get polluted with
    > questions like this.[/ref]

    Feel free not to answer then.
     

    ftoomch Guest

  11. #11

    Default Re: Where does PATH get set for root user?

    ftoomch <com> wrote:

     [/ref]
     

    We don't want people running X as root, so I feel free to post, if
    there's anything concerning that.

    Good luck

    --
    Michael Heiming

    Remove +SIGNS and www. if you expect an answer, sorry for
    inconvenience, but I get tons of SPAM
    Michael Guest

  12. #12

    Default Re: Where does PATH get set for root user?

    On Sun, 19 Oct 2003 07:36:34 +0000, armin walland wrote:
     
    >
    > this is correct and the way it should be.

    >
    > 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.
    >[/ref]

    Presumably you have a reason for this. Myself I have no problems logging
    in to X as root and running programs like this. Been doing it for years
    and never had any problems.
     

    spamtrap Guest

  13. #13

    Default Re: Where does PATH get set for root user?

    On Sun, 19 Oct 2003 18:08:32 +0200, Michael Heiming wrote:
     [/ref]

    >
    > We don't want people running X as root, so I feel free to post, if
    > there's anything concerning that.
    >[/ref]

    So you now want to turn GNU/Linux in to windows?

    Just because you and other people like you don't want people running X as
    root does not mean it has to be the case. Myself I have no problems
    running X as root and have not for years.

    Oh yeah, before you start calling me a newbie and other such things I'll
    point out to you that I am a professional systems engineer and
    administrator and I still do not have any problems with people running X
    as root.
     

    spamtrap Guest

  14. #14

    Default Re: Where does PATH get set for root user?

    On Sun, 19 Oct 2003 09:07:05 +0200, Michael Heiming wrote:
     
    >
    > 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'.
    >[/ref]

    Yeah there is. My reason is simply that sometimes I want to login as root
    and do a number of things in X that I cannot be bothered to do via su.
     

    spamtrap Guest

  15. #15

    Default Re: Where does PATH get set for root user?

    Jan Ceuleers wrote:
     
    >
    > ~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[/ref]

    This verges on the neurotic. :)

    --
    Paul Lutus
    http://www.arachnoid.com

    Paul Guest

  16. #16

    Default Re: Where does PATH get set for root user?

    spamtrap <co.uk> wrote:
    [..] 
     

    More and more people come to Linux, and sooner or later there will be
    some malicious progs, people tend to click on everything, like idiots.
    If they now run X as root and destroy their whole system, then they will
    for sure blame Linux. If you think you are "clever" enough to run X as
    root, fine even, but please don't suggest it here, were lots of newbies
    will read it.

    --
    Michael Heiming - RHCE

    Remove +SIGNS and www. if you expect an answer, sorry for
    inconvenience, but I get tons of SPAM
    Michael Guest

  17. #17

    Default Re: Where does PATH get set for root user?

    On Sun, 19 Oct 2003 09:07:05 +0200, Michael Heiming <michael+heiming.de> wrote: 
     [/ref]
     

    Funny. Every linux system I've seen runs X as root via the init scripts.

    Are you confusing X with a desktop manager?
    TCS Guest

  18. #18

    Default Re: Where does PATH get set for root user?

    spamtrap wrote:

    < snip >
     
    >
    > So you now want to turn GNU/Linux in to windows?[/ref]

    How precisely does offering sound advice turn Linux into Windows?
     

    Do you even grasp the distinction between advice freely offered in a
    newsgroup, and forcing user compliance using a closed system like Windows?
     

    So we know what kind of judgment you have. I know pilots who don't bother to
    refuel before flying over solid cloud decks, too. This doesn't make them
    rocket scientists.
     

    Good thing you don't revel your true identity. People who post brainless
    opinions *must* have handles like "spamtrap" instead of real names. If they
    instead did the latter, they would have to accept more responsibility -- or
    risk being unemployed.

    Using anonymous handles also allows you to say absolutely anything without
    significant chance of being called on a lie.

    --
    Paul Lutus
    http://www.arachnoid.com

    Paul Guest

  19. #19

    Default Re: Where does PATH get set for root user?

    On Sun, 19 Oct 2003 18:04:58 +0100, spamtrap <co.uk> wrote: 
     
    >>
    >> 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'.
    >>[/ref][/ref]
     

    Like? You only have to run su once to become root.

    TCS Guest

  20. #20

    Default Re: Where does PATH get set for root user?

    spamtrap wrote:
     
    >>
    >> 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'.
    >>[/ref]
    >
    > Yeah there is. My reason is simply that sometimes I want to login as root
    > and do a number of things in X that I cannot be bothered to do via su.[/ref]

    Those are things you can do without invoking X windows at all, or by opening
    a shell and "su" from within X. This is prudence, not fascism.

    --
    Paul Lutus
    http://www.arachnoid.com

    Paul Guest

Page 1 of 4 123 ... LastLast

Similar Threads

  1. #40560 [NEW]: DIR functions do not work on root UNC path
    By andy at advancethermal dot com in forum PHP Bugs
    Replies: 2
    Last Post: February 21st, 01:09 PM
  2. Path - Site Root vs. Doent Relative
    By voxmaris in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: August 8th, 10:31 PM
  3. Determining FTP root folder from path?
    By jerrygarciuh in forum PHP Development
    Replies: 3
    Last Post: November 5th, 07:28 PM
  4. Replies: 4
    Last Post: September 22nd, 03:28 AM
  5. Updating Path information for ROOT
    By Daryl in forum Sun Solaris
    Replies: 4
    Last Post: August 12th, 01:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139