Many of the hacking tools on Kali Linux require root privileges to execute, not to mention all the ordinary Linux commands that require it. If you're sick of having to preface commands with
sudo and typing in the root password often, we have a couple of solutions for you.
You can login to the root user in terminal with the
sudo -i command, as we explain in our guide on Kali Linux default password. Alternatively, you can see our guide on enabling root login in Kali in order to login to the GUI with the root account.
The last option is to provide a normal user account with root privileges. In this guide, we'll go through the step by step instructions to grant root privileges to a normal user account on Kali Linux.In this tutorial you will learn:
- How to provide user with root privileges on Kali Linux
|Category||Requirements, Conventions or Software Version Used|
|Other||Privileged access to your Linux system as root or via the |
|Conventions|| # - requires given linux commands to be executed with root privileges either directly as a root user or by use of |
Provide user with root privileges on Kali
Open a command line terminal and follow along with the steps below to give root privileges to a user account.
- Use the apt package manager to install the
kali-grant-rootpackage on your system. You may find that it's already installed, in which case you just need to configure it, as we show in the next step.
$ sudo apt install kali-grant-root
- Next, configure the package we just installed by using the following command.
$ sudo dpkg-reconfigure kali-grant-root
Make sure you select the option to enable password-less privilege escalation and proceed by pressing enter.
That's all there is to it. For all future commands that you wish to execute as root, you can use the
sudo command, but will never be prompted for a password.
To verify it works, try logging out and back in, then type a command that would normally require root privileges.
$ sudo apt update
In this guide, we saw how to provide a normal user with root privileges in Kali Linux. Using the steps in this guide, you can preface any command with
sudo and never be hassled with entering a password. Kali developers must've known that some users would be annoyed when they disabled root login in recent versions, so they've given us multiple ways to restore functionality back to what it was.