Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, if you are logged in as user "kevin" and you want to switch to user "john", what is the difference between "su john" vs "su - john"?
Answer
"su john" just gives you all the permissions of john and changes a few env vars to match john's env vars (e.g. HOME) but "su - john" does an exact login mimick for john and actually runs all the initialization scripts that run when "john" logs in (and sets all the env vars for "john").

Question
In linux, if you are logged in as user "kevin" and you want to switch to user "john", what is the difference between "su john" vs "su - john"?
Answer
?

Question
In linux, if you are logged in as user "kevin" and you want to switch to user "john", what is the difference between "su john" vs "su - john"?
Answer
"su john" just gives you all the permissions of john and changes a few env vars to match john's env vars (e.g. HOME) but "su - john" does an exact login mimick for john and actually runs all the initialization scripts that run when "john" logs in (and sets all the env vars for "john").
If you want to change selection, open document below and click on "Move attachment"

11. User Accounts and Ownerships
e set to jack , but all other environment variables will be inherited. su is, therefore, not the same as a normal login. To get the equivalent of a login with su , run su - jack This will cause <span>all initialization scripts (that are normally run when the user logs in) to be executed. [What actually happens is that the subsequent shell is started with a - in front of the zero'th argument. This makes the sh

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.