I'm using a server that is shared with about 7 other people. We each have our own user account, but they don't have permissions to access most of what we need, so they're essentially useless other than for authentication.
Instead, we use sudo to become a different user (called 'dev'). The dev account is shared by everyone on the team, and a few others from a different team. Considering that this is the only account we have access to that has enough privileges to actually do work, it's very frustrating having to share it.
I have my own directory under dev's home directory. What I would like to do is be able to open a new shell session with my subdir as HOME, and source dotfiles from my subdir rather than from dev's HOME. That way I could have my own settings (.bashrc, .vimrc, etc.), I wouldn't be digging through other people's .bash_history when I press up and they wouldn't dig though mine.
I know I can kind of fake this by changing the HOME directory and sourcing dotfiles as needed, but I'd like a way to do this automatically when I sudo to the shared account, something like:
sudo -ui dev HOME=/users/dev/me bash
(this doesn't work as-is). Is there a way to do this?
I know the 'correct' solution is to not use a shared account in the first place, and give proper permissions to each user's account, but the server is owned and operated by a separate company, and their sysadmins have been adversarial to changes suggested by our group. We actually used to have a lot more access and tools available, but it was stripped when they found out that we were doing things they didn't want us to (nothing against contract or even unusual - the sysadmin is just petty)
sudo -i -u dev; chmod 02770 .
. If so, you then only need to convince the sysadmin to put you all in the same group.