1

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.

1
  • Try sudo -i -u username Commented Feb 8, 2011 at 20:23

1 Answer 1

8
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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.