Enable Root User in Kali Linux
Nowadays, Kali Linux does not use the root account as the default, which means that root log-in in Kali Linux now usually comes as disabled. This change can happen even after updating your system to the latest version. So in order to use the root account or switch to a superuser account, you need first to enable the root log-in. However, if you have just started using Kali Linux, it might be quite possible that many of you are wondering why we need to access the root user account. So let me explain; You can perform almost all the standard tasks as a normal user. However, several other important functions also exist that usually require the permission of the root user account or superuser.
In this guide, we will learn how to enable root log-in in Kali Linux with step-by-step instructions. This will allow you to log in as root in the GUI. No doubt many of you know, we can also log in to root on terminal using sudo -i command. So let us see a more convenient way to enable root log-in in the GUI.
Enable root log-in in Kali Linux
Open a terminal and follow the instructions below to enable root log-in in your GUI.
1. First of all, open the terminal, type, and execute the following command to install the kali-root-login
Now type the other given command press enter button as shown below:
Now, you have to set the root password with the following given command. To execute this command, you have to enter your password at least two times. However, you can also use the same password that you have used for your normal non-root account.
As you can see in the above-given image, we have successfully set up the password for the root account. Now you can return to the log-in screen by switching users, logging out, or rebooting the system.
To log in as the superuser (or root user), you need to type the root user name, which in our case is "root" and enter the correct password that we have just set up with the root user in the previous steps.
That's all there is to it. Now you can log in to GUI either as a root user or as a non-root user as per your requirements.
Note You can always execute commands as root while still using your normal user account by prefacing commands with sudo.