- **Epistemic status:** #budding To create a new user in [[Linux]] you will need to log into the system as a **root** user or an account with **sudo** privileges. There are two commands we can choose from, depending on your distribution, `adduser` and `useradd`. `useradd` can be found in any [[Linux]] system, but it **does not** create a home directory for the new user and sets a password by default. `adduser` is not a standard [[Linux]] command, but usually a Perl script that utilizes the `useradd` command in the background. The purpose of it is to give you the option of creating a home directory, set a password, among other things. [[Linux]] distributions such as Debian have this command. If your [[Linux]] distribution has this command, it is recommended you utilize it over `useradd`. ## adduser Enter the following command, changing the `<username>` to the one that you want: ```bash sudo adduser <username> ``` You will be asked to add a password and input some other information. Make sure to save the password in a password manager or your preferred secure storage for safekeeping. ## useradd Enter the following command, changing the `<username>` to the one that you want: ```bash sudo useradd -m <username> ``` The `-m` flag will create a home directory as `/home/username`. The next step to be able to log in is to create a password. You can utilize the following guide: [[Change password of a user in Linux]] ## Next step If this user is going to need `sudo` privileges, you will need to [[Add a user to the sudo group in Linux]] since they are not added automatically. --- ## References - Knowledge Base by phoenixNAP. “How to Add User to Sudoers or Sudo Group on Ubuntu,” March 19, 2019. <https://phoenixnap.com/kb/how-to-create-sudo-user-on-ubuntu>. - “How to Create Users in Linux (Useradd Command),” December 11, 2018. <https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/>. - Linux Handbook. “Useradd vs Adduser: What’s the Difference?,” March 5, 2019. <https://linuxhandbook.com/useradd-vs-adduser/>.