Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Redhat Linux using Bash

  1. I login in as myself
  2. sudo to another user

sudo -u bash

I want to call a bash_profile when I do this. When I run this, I get the following error

bash: /home/myuser/.bashrc: Permission denied

Myuser: the username that I log in with.

share|improve this question
Try sudo -i -u username – Zoredache Feb 8 '11 at 20:23
up vote 7 down vote accepted
sudo -i -u username

should trigger the login shell for that user, as suggested above, and pick up all their .whatever preferences.

Alternatively, I'm more in the habit of doing this:

sudo su - username
share|improve this answer

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.