$HOME variable gets lost when starting an X session - Slackware

This is a discussion on $HOME variable gets lost when starting an X session - Slackware ; When my X session (XFCE) starts, and I open an xterm (with loginshell enabled) my $HOME variable is empty. All of the 'dot' configuration files appear in the root / directory. Any config files in my normal home directory are ...

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 20 of 66

Thread: $HOME variable gets lost when starting an X session

  1. $HOME variable gets lost when starting an X session

    When my X session (XFCE) starts, and I open an xterm (with loginshell
    enabled) my $HOME variable is empty.

    All of the 'dot' configuration files appear in the root / directory.
    Any config files in my normal home directory are ignored, I have to
    copy them to the root.

    When I start the in command-line mode (init 3), my $HOME variable is
    there and working great.

    What do I need to change to get my X session to not destroy my $HOME
    variable?

    Thanks,
    PaulH

  2. Re: $HOME variable gets lost when starting an X session

    On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:

    > When my X session (XFCE) starts, and I open an xterm (with loginshell
    > enabled) my $HOME variable is empty.
    >
    > All of the 'dot' configuration files appear in the root / directory. Any
    > config files in my normal home directory are ignored, I have to copy
    > them to the root.


    You are *not* supposed to be logging into an X session as root, period.
    Create a user account for yourself.

    useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh
    passwd paulh

    Log out as root and don't log in as root again. If you really need to do
    something as root then use "su".

  3. Re: $HOME variable gets lost when starting an X session

    On Feb 27, 1:59 pm, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:
    > > When my X session (XFCE) starts, and I open an xterm (with loginshell
    > > enabled) my $HOME variable is empty.

    >
    > > All of the 'dot' configuration files appear in the root / directory. Any
    > > config files in my normal home directory are ignored, I have to copy
    > > them to the root.

    >
    > You are *not* supposed to be logging into an X session as root, period.
    > Create a user account for yourself.
    >
    > useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh
    > passwd paulh
    >
    > Log out as root and don't log in as root again. If you really need to do
    > something as root then use "su".


    You misunderstood my post. When I said "the root / directory" I meant
    the base of the directory tree. I didn't mean the "/root" home
    directory.

    Besides, does it make a difference to the $HOME variable who you're
    logged in as?

    -Paul

  4. Re: $HOME variable gets lost when starting an X session

    On Wed, 27 Feb 2008 14:05:45 -0800, PaulH wrote:

    > On Feb 27, 1:59 pm, Dave Uhring wrote:
    >> On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:
    >> > When my X session (XFCE) starts, and I open an xterm (with loginshell
    >> > enabled) my $HOME variable is empty.

    >>
    >> > All of the 'dot' configuration files appear in the root / directory.
    >> > Any config files in my normal home directory are ignored, I have to
    >> > copy them to the root.

    >>
    >> You are *not* supposed to be logging into an X session as root, period.
    >> Create a user account for yourself.
    >>
    >> useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh passwd
    >> paulh
    >>
    >> Log out as root and don't log in as root again. If you really need to
    >> do something as root then use "su".

    >
    > You misunderstood my post. When I said "the root / directory" I meant
    > the base of the directory tree. I didn't mean the "/root" home
    > directory.


    No, I did not misunderstand anything. You are not supposed to log in as
    root in any X session.

    > Besides, does it make a difference to the $HOME variable who you're
    > logged in as?


    Just for fun, why don't you post the output of

    head -1 /etc/passwd

  5. Re: $HOME variable gets lost when starting an X session

    On 2008-02-27, PaulH wrote:
    >
    > You misunderstood my post. When I said "the root / directory" I meant
    > the base of the directory tree. I didn't mean the "/root" home
    > directory.


    If you're able to write to / , you must be root, or really broke the
    permissions on / . To test the latter case, do

    ls -ld /

    I hope it looks like this:

    drwxr-xr-x 25 root root 4096 Feb 25 13:46 /

    If not, you could be in a heap o' trouble.

    > Besides, does it make a difference to the $HOME variable who you're
    > logged in as?


    Of course. bash will set $HOME based on your passwd entry. If you
    logged in as root, then you'll have root's home. If you logged in as
    you, you'll have your own $HOME.

    --keith

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  6. Re: $HOME variable gets lost when starting an X session

    On Feb 27, 4:42*pm, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 14:05:45 -0800, PaulH wrote:
    > > On Feb 27, 1:59 pm, Dave Uhring wrote:
    > >> On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:
    > >> > When my X session (XFCE) starts, and I open an xterm (with loginshell
    > >> > enabled) my $HOME variable is empty.

    >
    > >> > All of the 'dot' configuration files appear in the root / directory.
    > >> > Any config files in my normal home directory are ignored, I have to
    > >> > copy them to the root.

    >
    > >> You are *not* supposed to be logging into an X session as root, period.
    > >> Create a user account for yourself.

    >
    > >> useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh passwd
    > >> paulh

    >
    > >> Log out as root and don't log in as root again. *If you really need to
    > >> do something as root then use "su".

    >
    > > You misunderstood my post. When I said "the root / directory" I meant
    > > the base of the directory tree. I didn't mean the "/root" home
    > > directory.

    >
    > No, I did not misunderstand anything. *You are not supposed to log in as
    > root in any X session.
    >
    > > Besides, does it make a difference to the $HOME variable who you're
    > > logged in as?

    >
    > Just for fun, why don't you post the output of
    >
    > head -1 /etc/passwd


    root:x:0:0::/root:/bin/bash

  7. Re: $HOME variable gets lost when starting an X session

    On Feb 27, 5:03*pm, Keith Keller francisco.ca.us> wrote:
    > On 2008-02-27, PaulH wrote:
    >
    >
    >
    > > You misunderstood my post. When I said "the root / directory" I meant
    > > the base of the directory tree. I didn't mean the "/root" home
    > > directory.

    >
    > If you're able to write to / , you must be root, or really broke the
    > permissions on / . *To test the latter case, do
    >
    > ls -ld /
    >
    > I hope it looks like this:
    >
    > drwxr-xr-x *25 root root 4096 Feb 25 13:46 /
    >


    it says:
    drwxr-xr-x 49 root root 440 Feb 27 17:45 /


    > If not, you could be in a heap o' trouble.
    >
    > > Besides, does it make a difference to the $HOME variable who you're
    > > logged in as?

    >
    > Of course. *bash will set $HOME based on your passwd entry. *If you
    > logged in as root, then you'll have root's home. *If you logged in as
    > you, you'll have your own $HOME.
    >


    But, either way, I would have a $HOME entry. As it is, the $HOME
    variable is empty. And only when I'm in X. If I run 'init 3' and
    return to text mode, I can 'echo $HOME' and it's correct. 'cd ~'
    works, too.


    > --keith
    >
    > --
    > kkeller-use...@wombat.san-francisco.ca.us
    > (try just my userid to email me)
    > AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    > see X- headers for PGP signature information





  8. Re: $HOME variable gets lost when starting an X session

    On Wed, 27 Feb 2008 15:16:23 -0800, PaulH wrote:
    > On Feb 27, 4:42*pm, Dave Uhring wrote:


    >> Just for fun, why don't you post the output of
    >>
    >> head -1 /etc/passwd

    >
    > root:x:0:0::/root:/bin/bash


    Your $HOME should be well enough defined. Which display manager are you
    using for login? kdm is/should be the default although xdm will be used
    if kdm is not present. Actually gdm is the default but does not ship
    with recent releases of Slackware.

    Also, please create the user account and see if the same situation exists
    for that user.

  9. Re: $HOME variable gets lost when starting an X session

    On 2008-02-27, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:
    >
    >> When my X session (XFCE) starts, and I open an xterm (with loginshell
    >> enabled) my $HOME variable is empty.
    >>
    >> All of the 'dot' configuration files appear in the root / directory. Any
    >> config files in my normal home directory are ignored, I have to copy
    >> them to the root.

    >
    > You are *not* supposed to be logging into an X session as root, period.
    > Create a user account for yourself.
    >
    > useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh
    > passwd paulh
    >
    > Log out as root and don't log in as root again. If you really need to do
    > something as root then use "su".


    Out of curiosity -- nothing more -- isn't sudo more appropriate, aka, safer??

    ken

  10. Re: $HOME variable gets lost when starting an X session

    On Wed, 27 Feb 2008 19:25:56 -0600, No_One wrote:
    > On 2008-02-27, Dave Uhring wrote:


    >> Log out as root and don't log in as root again. If you really need to
    >> do something as root then use "su".

    >
    > Out of curiosity -- nothing more -- isn't sudo more appropriate, aka,
    > safer??


    Anything you can break using su can be broken using sudo.

  11. Re: $HOME variable gets lost when starting an X session

    On Feb 27, 6:38 pm, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 15:16:23 -0800, PaulH wrote:
    > > On Feb 27, 4:42 pm, Dave Uhring wrote:
    > >> Just for fun, why don't you post the output of

    >
    > >> head -1 /etc/passwd

    >
    > > root:x:0:0::/root:/bin/bash

    >
    > Your $HOME should be well enough defined. Which display manager are you
    > using for login? kdm is/should be the default although xdm will be used
    > if kdm is not present. Actually gdm is the default but does not ship
    > with recent releases of Slackware.
    >
    > Also, please create the user account and see if the same situation exists
    > for that user.


    No display manager, I boot directly to the XFCE desktop.
    (autoexec=teinit~4 is appended to the LILO command line)

    This is a LiveCD based on SLAX 6.0.0. (which is based on slackware)

    I'll try to create the user account and let you know how it goes.

    Thanks,
    PaulH

  12. Re: $HOME variable gets lost when starting an X session

    On Wed, 27 Feb 2008 18:06:19 -0800, PaulH wrote:

    > This is a LiveCD based on SLAX 6.0.0. (which is based on slackware)


    You might have told us that you are *not* using Slackware.

    > I'll try to create the user account and let you know how it goes.


    Don't bother. When you are actually using Slackware let us know.

  13. Re: $HOME variable gets lost when starting an X session

    On 2008-02-28, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 19:25:56 -0600, No_One wrote:
    >> On 2008-02-27, Dave Uhring wrote:

    >
    >>> Log out as root and don't log in as root again. If you really need to
    >>> do something as root then use "su".

    >>
    >> Out of curiosity -- nothing more -- isn't sudo more appropriate, aka,
    >> safer??

    >
    > Anything you can break using su can be broken using sudo.


    safer as in more secure -- less likely to expose the system etc etc etc

    ken



  14. Re: $HOME variable gets lost when starting an X session

    On Thu, 28 Feb 2008 08:42:54 -0600, No_One wrote:
    > On 2008-02-28, Dave Uhring wrote:
    >> On Wed, 27 Feb 2008 19:25:56 -0600, No_One wrote:


    >>> Out of curiosity -- nothing more -- isn't sudo more appropriate, aka,
    >>> safer??

    >>
    >> Anything you can break using su can be broken using sudo.

    >
    > safer as in more secure -- less likely to expose the system etc etc etc


    More secure than what? Expose the system to what? They are identical in
    their risks and sudo is so much more inconvenient to use that
    uncorrectable mistakes are even more likely to occur.

    Now if we are considering a system with multiple administrators, some of
    which cannot be trusted as root, then limited sudo privileges are better
    than giving the root password to everybody. That, however, is not the
    case here.

  15. Re: $HOME variable gets lost when starting an X session

    On 2008-02-28, Dave Uhring wrote:

    > More secure than what? Expose the system to what? They are identical in
    > their risks and sudo is so much more inconvenient to use that
    > uncorrectable mistakes are even more likely to occur.


    Okay - now I'm puzzled.

    >They are identical in their risks


    I r and r'd the manpages and I just don't see how that statement can be
    accurate.

    > sudo is so much more inconvenient


    How --

    >uncorrectable mistakes are even more likely to occur


    How --


    > Now if we are considering a system with multiple administrators, some of
    > which cannot be trusted as root, then limited sudo privileges are better
    > than giving the root password to everybody. That, however, is not the
    > case here.


    Granted...but not relevant.

    ken


  16. Re: $HOME variable gets lost when starting an X session

    On 2008-02-28, No_One wrote:
    > On 2008-02-28, Dave Uhring wrote:
    >
    >>They are identical in their risks

    >
    > I r and r'd the manpages and I just don't see how that statement can be
    > accurate.


    If you have sudo to any command as root, you can b0rk anything that you
    can bork with a full-on root shell.

    >> sudo is so much more inconvenient

    >
    > How --


    Because you have to sudo every command (which does mitigate some of the
    risk, just because if you make a typo, it may not even be permitted
    because you forgot to sudo; hopefully you catch the typo before you redo
    the command with sudo). If you're only doing one command that needs
    root, great! But what if you need multiple commands, or need a pipe
    with both commands needing root? Then sudo may as well be renamed pita.

    >>uncorrectable mistakes are even more likely to occur

    >
    > How --


    I think this would be rare, but imagine that you sudo visudo and b0rk
    sudoers, for example. If you don't even allow su, you are really
    screwed.

    I personally prefer to see that unfriendly

    #

    prompt, to remind me that I've got root powers, but I do understand that
    other people prefer sudo.

    --keith

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  17. Re: $HOME variable gets lost when starting an X session

    On 2008-02-28, Keith Keller wrote:
    >>
    >> How --

    >
    > Because you have to sudo every command (which does mitigate some of the
    > risk, just because if you make a typo, it may not even be permitted
    > because you forgot to sudo; hopefully you catch the typo before you redo
    > the command with sudo). If you're only doing one command that needs
    > root, great! But what if you need multiple commands, or need a pipe
    > with both commands needing root? Then sudo may as well be renamed pita.


    I wasn't aware the pipe and command seperators ( posed this problem. Live
    and learn.

    >
    >>>uncorrectable mistakes are even more likely to occur

    >>
    >> How --

    >
    > I think this would be rare, but imagine that you sudo visudo and b0rk
    > sudoers, for example. If you don't even allow su, you are really
    > screwed.
    >
    > I personally prefer to see that unfriendly
    >
    > #


    Point taken...for the record, I do use su, just not very often and my root
    prompt is bright purple. Can't miss it, but I do.

    ken


  18. Re: $HOME variable gets lost when starting an X session

    On Feb 27, 11:59 am, Dave Uhring wrote:
    > On Wed, 27 Feb 2008 10:52:26 -0800, PaulH wrote:
    > > When my X session (XFCE) starts, and I open an xterm (with loginshell
    > > enabled) my $HOME variable is empty.

    >
    > > All of the 'dot' configuration files appear in the root / directory. Any
    > > config files in my normal home directory are ignored, I have to copy
    > > them to the root.

    >
    > You are *not* supposed to be logging into an X session as root, period.
    > Create a user account for yourself.
    >
    > useradd -c 'Your Name' -d /home/paulh -m -s /bin/bash paulh
    > passwd paulh
    >
    > Log out as root and don't log in as root again. If you really need to do
    > something as root then use "su".


    I run as root. A lot of people do. Why shouldn't I? I AM root here.

    And despite all the paranoid blather such as you have parroted
    here, we never have any problems because of it.

    All of the setuid and sudo and su and other measures needed to run
    apps as non root just add to the complexity of your system and
    counter-balance the security advantages of running as non-root.

    I have no problem running X as root, so I don't know how to address
    his problem. Never encountered it. My $HOME is /root.

    I su to an ordinary user account when necessary.

    KISS and ignore the numerous paranoids in the computer
    world, for the most part.

    Tom Newton

    calhobbit
    AT gmail
    dot com

  19. Re: $HOME variable gets lost when starting an X session

    Tom N wrote:

    > I su to an ordinary user account when necessary.


    How do you manage that? If root invokes the command su and then presses
    the carriage return key the result is that one is returned to the
    command line prompt for root, vide:
    root@xxxxx:~# su
    one then presses the carrage return or 'enter key and is then presented
    with, the command line prompt for 'root',exit
    root@xxxxx:~#

    Do you actually know what you're doing? Do you actually know what you're
    talking/writing about?

    --
    Two Ravens
    "...hit the squirrel..."

  20. Re: $HOME variable gets lost when starting an X session

    Two Ravens wrote:


    > presented with, the command line prompt for 'root',exit
    > root@xxxxx:~#


    My apologies for the exit following 'root' in the sentence above, I
    omitted to click on the composer window of Kmail,before I typed exit
    and hit enter to get rid of the shell console I was using to check that
    I had typed in the root prompt on the command line accurately.
    --
    Two Ravens
    "Tom Newton, surely the William Topaz McGonagall of
    alt.os.linux.slackware, and now, seemingly, comp.os.linux.setup and
    comp.os.linux.misc.as well!"

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast