Situation: In web development I need to be logged into an application as an administrator, normal user, unauthenticated user etc. I'd like to have a set up where each browser window is unaware of the other's logged in session.
Question: How can I have multiple browser windows open but have them running from different profiles or different cache areas? If firefox profiles, how can I achieve this without using the Profile editor UI?
Can I create a temporary user, run Firefox, then just throw away the entirety of that user account? Or, should I be using like a browser-in-a-VM?
What I've tried so far:
Bash
My first attempt was to try something like the following:
# create temp user
tmp_user=`head -c 10 /dev/random | base64 | head -c 10`
# create user
sudo useradd $tmp_user;
# run browser
sudo -u $tmp_user `which firefox`
# hold and wait then kill account
sudo userdel $tmp_user
I got so far as sudo -u $tmp_user firefox
the following error displayed:
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory Unable to init server: Could not connect: Connection refused Error: cannot open display: :0
Firejail
I then tried firejail, however, I think I misunderstood what this prgoram was meant to do. The main firefox window and one started under firejail firefox
was aware of each others login sessions.
With Chromium, or Google Chrome, just tell it to use different data directories:
Then you can just delete these directories when you're done.
Or if you want random temporary directories: