We will explain how to create a new user and get root privileges in Kali Linux. As we entered 2020, the new Kali version was released and we installed and tried this new version on my virtual machine. The familiar
root/toor user no longer exists. When we put the machine down and the system up for the first time, we realized it when we tried logging in. In Kali Linux 2020.1, we log in by typing the default user
Kali Linux (2020.1) How to Create a New User?
The user will be created using
useraddthe command. Then we will set the password with the
passwd command. The -m command will create the user’s home directory on kali. It will enable login with the user you created.
sudo useradd -m username // add -m new user sudo passwd username // creating a password for the user we created
Adding to the Sudo Group
In this section, we will add the user to the sudo group and finally change the default shell of the newly added user to bash.
sudo usermod -a -G sudo username sudo chsh -s /bin/bash username
Using The `su` Command
We can switch to the user we created using the su command.
You should update the Kali Linux system as soon as possible with every reboot or make some basic changes for more stable and secure. You can update and upgrade the Kali with the command below.
sudo apt-get update && apt-get upgrade
Logging in with a New User
To log in to the new user, log out of the root user.
Log in with the new user.
As you can see, the new user has been logged in and we have seen that the user is “omer” with the “whoami” command.