[NTLUG:Discuss] Re: SuSE 9 or 9.1 PATH environment changes after su
Chris Cox
cjcox at acm.org
Fri Sep 10 12:26:06 CDT 2004
terry wrote:
...snip...
> I'm thinking that aliasing su - to su is pretty handy because I, for
> one, find no need to just use su without -
>
> My question is, (and I know I'm probably showing my ignorance here,
> but), in what case would it be better to use su without - ?
>
Consider a case where you want to become a user (even root) and
DON'T want to have their login profiles run. Another useful case is when
you have NFS mounted home dirs and don't want the home dir to
get mounted as you become the user.
su is used to change to a different user. The "-" gives you a
"login" shell.. just as if you actually logged in as the user.
Things are supposed to be different for becoming root when you just do an
"su" (so you don't inherit the user's PATH and accidentally do
something stupid, etc). But I've noticed that Red Hat (possibly
others) don't do that when becoming root.
More information about the Discuss
mailing list