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 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
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.
su username
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 in with the new user.
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.
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.