Set Kali root password and enable root login

In order to enable root login for Kali Linux, we must set the the root password manually. In past versions of Kali Linux, users were able to log in directly to the root account by default. On more recent versions, this has been disabled. The reasoning behind this change should be obvious, but if you’re a Kali user, you probably know your way around a Linux system by now, and there’s not much risk in letting you use the root account to log in.

Kali developers must’ve known that this change would annoy some people, because they’ve made it very convenient to re-enable the root login. In this tutorial, we’ll go through the step by step instructions to enable root login in Kali Linux. This will permit you to login to the GUI as root. Of course, we’re already able to login to root on the terminal with the sudo -i command.

NOTE
You can always execute commands as root, while still using your normal user account, by prefacing commands with sudo. For help with using sudo or logging into the root account in terminal, see our guide on Kali Linux default password.

In this tutorial you will learn:

  • How set root password and enable root login on Kali Linux
Set Kali root password and enable root login
Set Kali root password and enable root login
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Kali Linux
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Enable root login and set Kali root password



WARNING
It is generally a bad idea to log in to the GUI as a root user, or to execute all commands with root permissions. It is assumed that since you are using Kali Linux, this is not your main workstation and you have enough Linux experience that you will not make any huge blunders. Still, if in doubt, stick to using a normal account and only escalating to root permissions when necessary.

Open a terminal and follow the steps below to enable root login in your GUI.

  1. First, use the apt package manager to install the kali-root-login package.
    $ sudo apt update
    $ sudo apt install kali-root-login
    

    Install the kali-root-login package with apt command

    Install the kali-root-login package with apt command
  2. Next, you need to set the root password with the passwd command. Even just setting it to the current password of your user account is fine, but this command must be run.
    $ sudo passwd
    [Enter password twice]
    

    Once executed, the new root password has been set to your desired passphrase.

  3. Now you can return to the login screen by switching users, logging out, or restarting the system.

    Switch user or log out of your current session to access root account

    Switch user or log out of your current session to access root account
  4. Login with the root user account and the password you just set in the previous steps.

    Login with root account

    Login with root account


NOTE
That’s all there is to it. You can now log in to the GUI as root, and of course your normal user account if you want. To see other ways to log in to your terminal with the root user account, see our tutorial on How to switch to root on Linux

Logged into the root account in GUI on Kali Linux

Logged into the root account in GUI on Kali Linux

Closing Thoughts

In this tutorial, we saw how to enable root login on Kali Linux. By default, we are already able to login to the terminal as root with the sudo -i command, but root login for the GUI was disabled in the latest versions of Kali. After following these steps, you’re now able to login to both GUI and terminal as root.