Why use "su -" rather than "su"

Mike McCarty mike.mccarty at sbcglobal.net
Fri Jul 15 21:19:38 UTC 2005


Peter Arremann wrote:

>On Friday 15 July 2005 12:06, Mike McCarty wrote:
>  
>
>>Hmm. So I give up my regular editor in return for not having to type /sbin/
>>
>>Well, I think I'll go along the way I am. I'm a pretty good typist.
>>
>>I thought there might be a *real* reason, and I had missed something. I
>>was wondering if there might be some subtle problems which would bite
>>me later.
>>    
>>
>
>The main reason for most unix admins to use 'su -' is that it sets the 
>environment... Some people put nasty things like "." into their path or do 
>other things that might break stuff - LD_LIBRARY_PATH, ... there is tons of 
>things that you usually don't want in the environment of the root user. Hence 
>you use the dash and get rid of all of that... A long long time ago I 
>actually remember discussions of switching the behavior of su to default to 
>"su -" and having an additional switch for it to _not_ give you a login shell 
>- all that simply because su without the dash can be such a nightmare... 
>
>Peter.
>
>  
>
I haven't found it to be a problem. I was just concerned that it
might be later. I have never put "." into my path.

Mike

-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!




More information about the fedora-list mailing list