Until recently, Kali Linux used the root account by default and now you need to set Kali root password manually. In the latest versions of Kali, root login is disabled, forcing you to login to the GUI as your normal user account. 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 login. 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 guide, 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.
You can always execute commands as root, while still using your normal user account, by prefacing commands with
sudo. For help with using
sudoor 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
|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
$ – requires given linux commands to be executed as a regular non-privileged user
Enable root login and set Kali root password
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.
- First, use the apt package manager to install the
$ sudo apt update $ sudo apt install kali-root-login
- Next, you need to set the root password with the
passwdcommand. 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.
- Now you can return to the login screen by switching users, logging out, or restarting the system.
- Login with the root user account and the password you just set in the previous steps.
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.
In this guide, 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.