• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

'su' vs 'su -' is there a difference?

Mucman

Diamond Member
A friend of mine said that when su'ing to root to type "su -" and not "su"... he said it had something to do with umask, but I don't know what the heck he is talking about.
 
i dont think so, maybe su -c, but i think - indicates a switch is coming, but then you dont type one

root is uid 0 either way

at least i think
 
hmm... my friend was saying to do this when installing things... he says sometimes when using plain "su" permissions or ownerships get messed up or something. I am going to ask him about it again tommorrow.
 
'su -' runs the profile of the user you change to - i.e. 'su - root' runs roots .profile. Just a normal 'su' without the dash doesn't run the profile.

Normally you would probably always do the 'su -', unless you don't want the profile for some specific reason (like it automatically runs an application, etc.)

 
just typing su doesn't load paths and whatnot (profiles as said above) which can be an issue if you are trying to install a program which expects a certain command to be in the path (therefore it'll just run, say, dothisnow as opposed to /usr/loadthisnow or something). when it's not it will error out saying it can't be run. su - is like logging in at the prompt as root. which is probably why your friend said to use 'su -'.

~erik
 
Back
Top