To create a new user in a Linux system, you can use the useradd command. Here’s a step-by-step guide:
-
Open the terminal.
-
Run the following command to create a new user (replace
usernamewith your desired username):sudo useradd -m -s /bin/bash usernamesudo: 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.
-
Set a password for the new user:
sudo passwd username -
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!
