Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

You need to use

$su -

and not just $su, to make a login shell (and cause it to source the .bashrc)

Did you do that?

share|improve this answer
That worked, thanks :) – Ian Dunn Jun 27 '11 at 22:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.