5

If I want to use the Tor browser as a non root user is there a way to do it without having to completely logout of the root workspace and log back in as another user?

Basically have the browser run without root privileges?

Using Debian/Ubuntu Linux.

Dirk Calloway
  • 183
  • 1
  • 3

2 Answers2

3

You can run any command as a different user using sudo:

sudo -u my_user tor-browser-en

If you need to use multiple commands you can do this:

sudo -u my_user sh -c "first && second"

If you want to background the application, you should not do this (it will only work as expected if you're already authenticated with sudo):

sudo -u my_user tor-browser-en & # Don't do this

but rather this:

sudo -u my_user sh -c 'tor-browser-en &'

The latter will ensure that you're asked for the sudo password before the browser is run in the background.

l0b0
  • 210
  • 1
  • 11
0

I tried the above solution but I kept getting permission errors. This is how I fixed it (it's a permissions issue):

Add a new user

adduser <username>

Make sure a home directory exists for that user

mkdir /home/<username>

On the root account, copy the tor folder containing the executable you downloaded to the home folder for the non-root user:

mv ~/Downloads/tor-browser-linux64-9.0.9_en-US.tar.xz /home/<username>/

Change the permissions like so:

chown -R <username>:/home/<username>

To give the ownership of that folder to the non-root account. Then you'll be able to unzip/execute whatever you want in that folder as the non-root user. Hope that helps!