How to Set Up Your First User Account in Kali Linux

When you first install Kali Linux, the default user is root, which gives you full system control but is not safe for everyday use. Creating a separate username and password lets you work normally while keeping the root account protected for administrative tasks only. You do this through the terminal using the useradd command, which takes about five minutes and requires you to know only a few commands.

The process works the same whether you are setting up your first non-root user or adding additional users later. You will create the username, set a password, create a home directory, and assign the user to the sudo group so they can run administrative commands when needed.

Key Takeaways

  • Open a terminal and log in as root, then use the command useradd -m -s /bin/bash username to create a new user with a home directory and shell access.
  • Set the password when ready after with passwd username, then type your chosen password twice when prompted.
  • Add the new user to the sudo group using usermod -aG sudo username so they can run administrative commands.
  • Switch to the new account with su - username to test that the login works before you log out of root.

Opening the Terminal and Logging In as Root

Start by opening a terminal window. In Kali Linux, you can do this by right-clicking on the desktop and selecting "Open Terminal Here", or by clicking the terminal icon in the taskbar if one is visible. When the terminal opens, you are usually already logged in as root, which you can confirm by looking at the prompt — it should end with a # symbol rather than a $.

If you are not logged in as root, type su - and press Enter, then type the root password when prompted. The dash after su loads the root user's environment, which is important for the commands that follow to work correctly.

Creating the New User Account

At the root prompt, type the following command exactly, replacing username with the name you want to use:

useradd -m -s /bin/bash username

Press Enter. This command does three things: -m creates a home directory for the user (usually in /home/username), -s /bin/bash sets bash as the default shell so the terminal works normally, and username is the account name itself. Choose a username in lowercase with no spaces — something like alice or workstation works well.

The command produces no output if it succeeds, which is normal. If you see an error saying the user already exists, choose a different username and try again.

Setting the Password for the New User

when ready after creating the user, set a password by typing:

passwd username

Press Enter. The terminal will prompt you to enter a new password. Type your chosen password and press Enter — the characters will not appear on screen as you type, which is normal. You will then be asked to retype the password to confirm it. Type it again and press Enter.

If the passwords match, you will see a message like "passwd: password updated successfully". If they do not match, the system will ask you to try again. Choose a password you can remember but that is not a word from a dictionary — mixing uppercase, lowercase, numbers, and symbols makes it stronger.

Adding the User to the Sudo Group

To let your new user run administrative commands when needed, add them to the sudo group. Type:

usermod -aG sudo username

Press Enter. This command modifies the user account (usermod), appends them to a group (-aG), and the group is sudo. Again, replace username with the actual name you created. No output means the command worked.

Without this step, the user can log in and work normally, but they cannot run commands that require root permission. With it, they can use sudo before a command to run it with elevated privileges — for example, sudo apt update to update the package list.

Testing the New Account Before You Log Out

Before you close the terminal or log out of root, test that the new account works. Type:

su - username

Press Enter and type the password you just created. If the login succeeds, the prompt will change to show your username instead of root, and it will end with a $ instead of #. You are now logged in as the new user.

To verify that sudo access works, type:

sudo whoami

Press Enter and type your password again when prompted. If the output is root, the sudo group membership is working correctly. Type exit to return to the root prompt, then type exit again to close the terminal.

What to Do If Something Goes Wrong

If the user creation command fails with "user already exists", the username is taken. Choose a different name and run useradd -m -s /bin/bash newusername with the new name.

If you forget the password, log back in as root and run passwd username again to set a new one. If you cannot remember the root password itself, you will need to boot into recovery mode or reinstall Kali, so write down the root password somewhere safe before you finish.

If the new user cannot run sudo commands even after you added them to the group, log back in as root and run usermod -aG sudo username again to confirm the command completed. Then have the user log out and log back in — group membership changes take effect on the next login.

Frequently Asked Questions

Can I create multiple users on the same Kali system?

Yes. Run the useradd command for each user with a different username, then set passwords and add them to sudo as described. Each user gets their own home directory and can log in separately.

What if I want to delete a user I created by mistake?

Log in as root and type userdel -r username. The -r flag removes the user and their home directory. Be certain before you run this — it cannot be undone.

Do I need to add every new user to the sudo group?

Only if they need to run administrative commands. Users not in the sudo group can still log in and use the system normally, but they cannot install software or change system settings. For a shared system, you might create some users without sudo access.

Can I change my username after I create it?

Yes, but it is complicated. Log in as root and use usermod -l newname oldname to change the username, then usermod -d /home/newname -m newname to move the home directory. It is easier to create a new user and copy files over if you need a different name.

What happens if I forget to use the -m flag when creating a user?

The user account is created but without a home directory. They can still log in, but they will not have a place to store files. Log in as root and run mkdir -p /home/username to create the directory, then chown -R username:username /home/username to give them ownership of it.