How to create a new user?

To create a new user in a Linux system, you can use the useradd command. Here’s a step-by-step guide:

  1. Open the terminal.

  2. Run the following command to create a new user (replace username with your desired username):

    sudo useradd -m -s /bin/bash username
    • sudo: Runs the command with superuser privileges.
    • useradd: Command to create a new user.
    • -m: Creates a home directory for the user.
    • -s /bin/bash: Sets the default shell to bash.
  3. Set a password for the new user:

    sudo passwd username
  4. Verify the user creation by listing the home directories:

    ls -l /home

You should see a directory for the new user. If you have any questions or need further assistance, let me know!

0 Comments

no data
Be the first to share your comment!