When I switch from root user to a user (automatically created when installing git-auto-deploy) with
sudo -u git-auto-deploy /bin/bash
I always get this error:
bash: /root/.bashrc: Permission denied
I created a user home directory, and put a .profile
in it with the following (ran source
on it too):
export HOME=/srv/users/git-auto-deploy
The command finger git-auto-deploy
gives the following output:
Login: git-auto-deploy Name:
Directory: /srv/users/git-auto-deploy Shell: /bin/bash
Never logged in.
When logged in as this user, the env
command still lists incorrect directory:
HOME=/root
What am I doing wrong?
-l
option to yoursudo
? – Julie Pelletier Dec 29 '16 at 15:49/bin/bash
, doesn't even do the user switch. – montrealist Dec 29 '16 at 16:18