Los Angeles1
asked on
RHEL 6 su command question
What is the difference between
and
I looked up the man page and it states:
Doesn't "su tcn" change the user id. Would this command not change the group id without the dash ?
su tcn
and
su - tcn
I looked up the man page and it states:
Change the effective user id and group id to that of USER.
-, -l, --login
Doesn't "su tcn" change the user id. Would this command not change the group id without the dash ?
With su you just become that user but home directory will not be changed and it will not read his .bash_profile and .bashrc so env variable set by him will not be available but
With su - it is like you have logged in with that user. home directory will be changed. Path will be set according that user. It will read that users .bash_profile and .bashrc, all custome env variable will be available.
With su - it is like you have logged in with that user. home directory will be changed. Path will be set according that user. It will read that users .bash_profile and .bashrc, all custome env variable will be available.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The effective IDs are only changed with "su -", and also the login profile of the target user is only executed with "su -".
wmp