BLOG POSTS
How to Add a User in Ubuntu (Linux) For Beginners

How to Add a User in Ubuntu (Linux) For Beginners

Adding a new user in Ubuntu is a straightforward process that can be done using the command line. This guide will walk you through the steps to add a user in Ubuntu, along with some useful commands and tips.

Step 1: Open the Terminal

To begin, open the Terminal by pressing Ctrl + Alt + T on your keyboard. The Terminal is the command line interface in Ubuntu where you can execute various commands.

Step 2: Add a User

Now, let’s add a new user to the system. Use the following command:

sudo adduser username

Replace “username” with the desired username for the new user. You will be prompted to enter a password and additional information like Full Name, Room Number, Work Phone, etc. You can leave these fields blank by pressing Enter if you don’t want to provide any information.

Step 3: Grant Administrative Privileges (Optional)

If you want to grant administrative privileges to the new user, you can add them to the “sudo” group. Use the following command:

sudo usermod -aG sudo username

Replace “username” with the username of the user you want to grant administrative privileges to. This will allow the user to execute commands with root privileges.

Step 4: Verify User Creation

To verify that the user has been successfully created, you can use the following command to list all users on the system:

cat /etc/passwd

This will display a list of all users, including the newly created user.

Additional Commands and Tips

Here are some additional commands and tips related to adding users in Ubuntu:

  • sudo deluser username: This command can be used to delete a user from the system. Replace “username” with the username of the user you want to delete.
  • sudo passwd username: Use this command to change the password for a user. Replace “username” with the username of the user whose password you want to change.
  • sudo chage -E yyyy-mm-dd username: This command can be used to set an expiration date for a user account. Replace “yyyy-mm-dd” with the desired expiration date and “username” with the username of the user whose account you want to set an expiration date for.
  • sudo usermod -l new_username old_username: Use this command to change the username of an existing user. Replace “new_username” with the desired new username and “old_username” with the current username of the user.

Useful Data Table

Command Description
sudo adduser username Adds a new user to the system
sudo usermod -aG sudo username Adds the user to the sudo group to grant administrative privileges
sudo deluser username Deletes a user from the system
sudo passwd username Changes the password for a user
sudo chage -E yyyy-mm-dd username Sets an expiration date for a user account
sudo usermod -l new_username old_username Changes the username of an existing user

Adding a user in Ubuntu is a fundamental task that allows you to create separate accounts for different users and manage their privileges. By following the steps outlined in this guide, you can easily add a new user to your Ubuntu system.



This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.

This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.

Leave a reply

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