.bashrc doesn't get sourced after su'ing to root
Posted
by
Ian Dunn
on Server Fault
See other posts from Server Fault
or by Ian Dunn
Published on 2011-06-27T22:24:35Z
Indexed on
2011/06/28
0:23 UTC
Read the original article
Hit count: 230
I've got a CentOS 5.6 VPS and both root and my normal user account have identical copies of a .bashrc file in their home directories. The file contains a few basic aliases, etc.
- If I login to root, root's copy gets sourced.
- If I login to myuser, myuser's copy gets sourced
- If I su to root after logging into myuser, then all the aliases, etc inside myuser's copy get removed, and root's copy doesn't get sourced. If I then manually source root's copy, the command completes without any errors, but none of the aliases's etc get applied.
I've searched Google and Server Fault, but haven't found any solutions. Does anyone know how to fix that?
© Server Fault or respective owner