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.

0

2 Answers 2

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.

2
  • Here's a stupid question... how do I set it up so I can run "tor-browser-en" in the command line? Is there an apt-get way to download? I've looked but haven't seen one... Commented Nov 22, 2015 at 1:44
  • You might want to check/ask on askubuntu.com - I don't use a Debian derivative distro myself.
    – l0b0
    Commented Nov 22, 2015 at 19:34
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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .