how to create a user using linux terminal

How to create a new user on Linux using the Terminal Command

Within this blog post you will find a guide on how to create a new user on Linux and as an added bonus we will also be looking at how to change a password, and give sudo permission to an existing user. Well, without wasting any time, let’s get started with the process of achieving the required result. For demo purposes, we will be using WSL within the Windows OS, but these steps can be easily replicated in any Linux distribution.

Creating a new user using terminal

  • Open a new Terminal window and type the following command
  • sudo adduser <username>
  • change <username> to any username you want to create in the example we are creating “howhelper”
  • enter the password for the root user
  • you can fill all the fields or just add a password and hit enter for every other field.
  • type “y” to confirm all the information are correct
  • use su <username> to start using the new user.
Adding a new user example
Adding New Users

Change password of existing user

There are two ways to change the password of existing user. Through the root user or change the current user to the user who’s password need to be changed. We will be showing both methods choose which ever one suits your need.

Change User Password Using Root User

  • Open Terminal Window
  • Using the root user type the command below
  • sudo passwd <username>
  • change the <username> to required username
  • enter the root password then enter the new password for the user and retype to confirm
  • That’s all.
Changing Password for any User
Changing Password for any User

Change User Password Using Same User

  • passwd
  • enter the root password then enter the new password for the user and retype to confirm
  • That’s all.
Changing Password
Changing Password

adding user to sudo doers

Without the sudo access any user cannot use the sudo commands or access the root session. So here is a bonus step by step guide for you all from which you can add a user to sudo doers.

  • Open the Terminal Window and enter change to the root user.
  • Then enter the command below
  • sudo usermod -a -G sudo <username>
  • change the <username> to the user you want to add the sudo doers
  • enter the password for the root user
  • this is all the step required to add a user to sudo doers.
Adding User to sudo Doers
Adding User to sudo Doers

That’s all for this article we have seen How to create a new user on Linux, change the password of existing user and adding user to sudo doers. Hope this article helped you. Leave a comment if you have any suggestions or questions.

Also if your interested in becoming an ethical hacker then have a look at this post which give you the informaiton about the top 5 site to learn ethical hacking .

Top 5 Sites To Learn Cyber Security For Free

1 thought on “How to create a new user on Linux using the Terminal Command”

Leave a Comment

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

Scroll to Top
Scroll to Top