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/kali
.
![Kali user-password-kali/kali](https://www.systemconf.com/wp-content/uploads/2020/08/img_5f3657811c13d.png)
Kali Linux (2020.1) How to Create a New User?
The user will be created usinguseradd
the 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
![useradd and passwd](https://www.systemconf.com/wp-content/uploads/2021/03/img_6051f540f13f4.png)
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
![usermod -a -G and chsh -s /bin/bash](https://www.systemconf.com/wp-content/uploads/2020/08/img_5f36992595301.png)
Using The `su` Command
We can switch to the user we created using the su command.
su username
![su username](https://www.systemconf.com/wp-content/uploads/2020/08/img_5f369a1289610.png)
Updating Kali
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 out](https://www.systemconf.com/wp-content/uploads/2020/11/img_5fbf578e2ad92.png)
Log in with the new user.
![Log in new user](https://www.systemconf.com/wp-content/uploads/2020/11/img_5fbf57b1c3a82.png)
Whoami command
As you can see, the new user has been logged in and we have seen that the user is “omer” with the “whoami” command.
![whoami](https://www.systemconf.com/wp-content/uploads/2020/11/img_5fbf580671625.png)
hey omer when i try to update/upgrade kali it says “unable to acquire the dpkg frontend lock (), are you root?”
go to root do “sudo su” or add ‘sudo’ in the front of command
enter “sudo su” to be root.
You’ll know you’re root by the prompt being ‘#’
Hl jojinua
Become root with the command “sudo su” and then update again.