If you’ve ever utilized Kali Linux before, you most likely already know that it will automatically run nearly anything as the usual root user. And even though this aspect has its own, specific purpose, it’s not the best option when it comes to browsers such as Tor, as you might end up risking your security.
For that reason, you might need to create a new account that is non-root, while also having a home directory, for the specific reason to run Tor. Here’s a quick guide detailing how you could do just that:
Installing Tor on Kali Linux
To install and use the Tor browser on your device, simply follow the steps below:
- Firstly, you must make a new Linux user. To do this, simply enter ‘adduser –home-dir /home/kali kali’. You might need to add a password along with some additional information in order to make a new kali user.
- The next step is to download Tor. You can either do this manually by visiting the Tor website, or by utilizing a torbrowser-launcher package that will do the job for you.
- Finally, you could then install either Tor directly or the Tor Launcher via the usual apt process.
Note: While the Tor Launcher is a third-party software, it significantly simplifies the process of installing Tor, and helps to keep it updated automatically.
Configuring the Tor Launcher
If you’ve decided to use the Tor Launcher, keep in mind that you can’t run it immediately as root, considering the fact that Tor will likely be automatically blocked. However, you do have the opportunity to launch this order as the kali account.
Firstly, you must ensure that the kali account is registered in xhost to avoid any errors. Just use the ‘xhost si:localuser:kali’ order. This will give Tor the ability to function accordingly as the non-root account.
The next step would be to launch the Tor Launcher as an additional user like this: ‘sudo -u kali -H torbrowser-launcher’. The necessary files for Tor will then be downloaded during the initial launching of this command, and can be located in the /home/kali directory.
Once the setup has been completed, a window with the Tor connection should then be prompted, and the Tor web browser loaded right after it.
And that would be it; the best and safest solution for installing and running Tor when utilizing Kali Linux.