Welcome to today's blog post, in this post I am going to tell you how to run Brave as a root user in Kali Linux.
If you installed Brave in Kali Linux then you must face this issue that is we cannot run the Brave browser as a root user in Kali.
This means when we log in to the root user in Kali and try to start Brave then it won't start. So let's first understand why this happens.
We need to have knowledge of why is not open to solve this. And you must listen “Half knowledge is more dangerous than having no knowledge”.
Why we cannot run Brave as root in Kali Linux
So in modern browsers, there is a security named sandbox and the sandbox is responsible for this. Now let's see what is sandbox.
Sandboxing is an important security measure in modern browsers that helps contain any potential exploits or malicious code within the browser's environment, preventing them from affecting the rest of the system.
let's see how we can run it.
Now you know what we are going to do for running brave as root in Kali Linux. So let's see how to do this. There are two methods to run brave as root.
We are going to disable the sandbox to run the browser pls make sure this option effectively disables a crucial layer of protection, making the browser more vulnerable to security threats.
Method 1. By command line
So in this method, we run a command with an option. To run the brave as root run the following command.
brave-browser --no-sandbox
Now what this command does is disable the sandbox and allow the user to run a browser. You need to run this command every time you want to browser as root in Linux. You can run any application with --no-sandbox
option that uses sandbox.
Method 2. Modifying browser file
So now in this method, we are going to apply the same thing but in the browser's file so that we dont need to run this command every time and we can run the brave directly from the dock or application menu.
To do this, go to /opt/brave.com/brave
here you will find a file named "brave-browser". open it with any text editor. now go to the last line of this text file and you will find text something like "$HERE/brave" "$@" ||true
This line is the reason preventing Brave from running on the root user.
so replace "$HERE/brave" "$@" ||true
with
"$HERE/brave" "$@" --user-data-dir --no-sandbox
Save this and now you will be able to run Brave as the root user.
Final thoughts
We can run Brave browser as root by removing the sandbox. but It reduces the security of the browser. You can use this method in that situation when you hardly need to run the browser as root. never compromise with security.