On Wed, Jul 17, 2013 at 5:23 PM, Cameron Simpson <[email protected]> wrote:
>
>
<snip>
>
> When you start using "su" you have some pitfalls to consider. Many
> programs rely on the $HOME environment variable to decide where
> files should go. If you use "su user2" instead of "su - user2" then
> $HOME will probably be user1's home directory. Chaos ensues.

The manual maintained at GNU.org is fairly clear that $HOME is set, so
chaos should be avoided.  I copied what is relevant below:

----
<http://www.gnu.org/software/coreutils/manual/html_node/su-invocation.html>
"By default, su does not change the current directory. It sets the
environment variables HOME and SHELL from the password entry for user,
and if user is not the super-user, sets USER and LOGNAME to user. By
default, the shell is not a login shell."
----

Do you use a different su?  If not, give it a try.  Open a terminal
and switch to a new user with just 'su user', then after password
entry type "echo $HOME".  It should return the home directory of
whatever user you specified.

For the record, I am not saying don't use "-" or "-l" as appropriate
with su.  I am also not suggesting appropriate use of the su program,
as that is at the discretion of a given system administrator and (in
my opinion) varies depending on how a system is used.


------------------------------------

To unsubscribe from this list, please email 
[email protected] & you will be removed.Yahoo! Groups 
Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/LINUX_Newbies/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/LINUX_Newbies/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to