2nd December 2022

How to Create a New User in Kali Linux?

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 put the system up for the first time, we realized it when we tried to log in. In Kali Linux 2020.1, we log in by typing default user kali/kali.

Kali user-password-kali/kali
Kali user-password-kali/kali

 

Kali Linux (2020.1) How to Create a New User?

The user will be created usinguseraddthe 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
useradd and passwd

 

Adding to 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
usermod -a -G and chsh -s /bin/bash

 

Using The `su` Command

We can switch to the user we created using the su command.

su username
su username
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 the new user, log out the root user.

log out
log out

 

Log in with the new user.

Log in new user
Log in new user

 

Whoami command

As you can see lastly, the new user has been logged in and we have seen that the user is “omer” with the “whoami” command.

whoami
whoami

 

3 thoughts on “How to Create a New User in Kali Linux?

Leave a Reply

Your email address will not be published. Required fields are marked *