How to Create a New User in Ubuntu

  • Post category:Ubuntu

Creating a new user in Ubuntu is a fundamental task for managing your system, whether for collaboration or personal use. This guide will walk you through both the graphical and command-line methods, allowing you to choose the one that best suits your preferences.

Method 1: Using the Graphical Interface

Step 1: Open Settings

Begin by clicking on the system menu located in the top right corner of your desktop and select Settings.

Step 2: Navigate to Users

In the Settings window, locate and click on the Users section to manage user accounts.

Step 3: Unlock Settings

To make changes, click on the Unlock button in the top right corner. Enter your password when prompted to gain access.

Step 4: Add User

Look for the Add User… button under the Other Users section and click on it to start creating a new user account.

Step 5: Fill in User Details

You will need to provide the new user’s full name. The username will be generated automatically, but feel free to change it if you wish. Decide whether to set a password now or allow the user to set one upon their first login. If you want to grant administrative privileges, choose Administrator as the account type.

Step 6: Finalize Creation

Once you’ve filled in the necessary details, click Add to create the new user account successfully.

Method 2: Using the Command Line

Step 1: Open Terminal

Press Ctrl + Alt + T to open the terminal, which will allow you to enter commands directly.

Step 2: Add a New User

Use the following command to add a new user, replacing newuser with your chosen username:

sudo adduser newuser

You will be prompted to enter a password and can provide additional information (such as the user’s full name), which you can skip by pressing Enter.

Step 3: Grant Sudo Privileges (Optional)

If you want to give this user administrative privileges, you can add them to the sudo group using the following command:

sudo usermod -aG sudo newuser

Step 4: Verify User Creation

To confirm that the user has been created successfully, you can list all users with:

cat /etc/passwd | grep newuser

Conclusion

Creating a new user on your Ubuntu system is straightforward, whether you prefer using the graphical interface or the command line. By following the steps outlined in this guide, you can effectively manage user accounts based on your needs.

For more tips and tricks on managing your Ubuntu system, check out our other guides on CodeAllow.