Frequent Question: How Do I Add a New User in Linux?
Contents How Do You Create a New User Account in Linux from the Command Line? to Create a User Account from a Shell Prompt: Open a Shell Prompt. If You Are Not...
Contents
How do you create a new user account in Linux from the command line?
To create a user account from a shell prompt:
- Open a shell prompt.
- If you are not logged in as root, type the command su – and enter the root password.
- Type useradd followed by a space and the username for the new account you are creating at the command line (for example, useradd jsmith).
How do I add a user to my home directory in Linux?
Creating a user account using useradd command on Ubuntu
- -s /bin/bash – Set /bin/bash as login shell of the new account.
- -d /home/vivek/ – Set /home/vivek/ as home directory of the new Ubuntu account.
- -m – Create the user’s home directory.
- -G sudo – Make sure vivek user can sudo i.e. give admin access to the new account.