Linux online course

Create User Accounts in Linux

Learn how to create local Linux users with Ubuntu User Accounts and adduser, choose account privileges, set passwords, and verify permissions.

A user account is a local identity used to log in to Linux and own files and processes. Each person who regularly uses a Linux computer should normally have a separate account.

Separate accounts provide distinct login identities, home directories, personal settings, file ownership, and permission boundaries. They also make it easier to change passwords, adjust group membership, disable access, or delete an account when circumstances change.

Permissions required to create an account

Creating a user is an administrative action because it changes the system's account database and usually creates a home directory. In the graphical tool, you must unlock the settings panel with an administrator password. In a terminal, you need an account authorized to use sudo or another form of elevated privilege.

An administrator-capable account is not the same as the root account. Root is the superuser with unrestricted privileges. Ubuntu normally expects an authorized administrator to run individual commands through sudo instead of logging in directly as root.

Choose an account type carefully

Standard user: Can log in and use personal applications and files, but normally cannot make broad system changes. This is the appropriate choice for most family members, students, guests with persistent accounts, and employees who do not administer the computer.

Administrator: Can perform privileged administration, commonly through membership in a sudo-capable group on Ubuntu. This may include installing software, changing system settings, and managing other accounts. Grant this access only when it is required.

Risk principle: Both account types can log in, but an administrator account has a greater impact if its password is stolen or misused.

Create a user with Ubuntu User Accounts

  1. Open the desktop Settings application.
  2. Locate and open User Accounts.
  3. If the panel is locked, select the unlock control and authenticate with an authorized administrator credential. The add-user controls may be unavailable until the panel is unlocked.
  4. Select the add-user control, often shown as a plus button or an Add User button.
  5. Choose Standard or Administrator. Select Standard unless the person genuinely needs system-administration privileges.
  6. Enter the person's full name. For example, enter Jamie Williams.
  7. Enter a login username, such as jwilliams.
  8. Complete the creation action and authenticate again if requested.
  9. Verify that the new account appears in the user list.
  10. Set or change the password if the interface presents a separate password control. Some Ubuntu versions ask for a password during creation; others require a separate password-setting step.

The account needs usable authentication credentials before the person can log in. A profile appearing in the user list does not by itself prove that password authentication has been completed.

Username and full-name rules

The username is the short identifier used at the login screen and in commands. The full name is optional descriptive metadata, commonly stored in the account comment field; it is not the login name.

  • Prefer concise lowercase usernames such as jwilliams.
  • Use only characters permitted by the local distribution and organization policy. Lowercase letters, digits, hyphens, and underscores are common choices.
  • Avoid spaces, ambiguous names, unsupported punctuation, and names that conflict with existing system accounts.
  • Use a strong, unique password that is difficult to guess and is not reused on another service.

Create a user with adduser

adduser is an interactive, higher-level account-creation utility commonly used on Debian- and Ubuntu-based systems. Run it with elevated privileges:

sudo adduser jwilliams
  1. Enter the administrator password if sudo requests it. The password is not displayed while you type.
  2. At the new user's password prompt, enter and confirm a password.
  3. Supply optional identity information, such as the full name, when prompted.
  4. Accept optional fields by pressing Enter, or leave them blank when they are not needed.
  5. Confirm the displayed information when adduser asks whether it is correct.

A successful invocation typically creates an account entry, a primary group, a home directory such as /home/jwilliams, and default files copied from the system skeleton directory. It also sets up the password during the interactive process.

After creation, the person should log in through the local login screen or another appropriate authentication method. A terminal test can also be performed without ending the administrator's session:

su - jwilliams

Use this only when you know the new account's password. Type exit to return to the previous shell.

Graphical interface versus command line

Graphical interface: Best for a desktop user who wants guided account creation. It requires authentication through the unlocked User Accounts panel. Password setup may occur during creation or in a separate account-password control. It is typical on Ubuntu desktop installations.

Command line with adduser: Best for administrators working in a terminal or over a managed local session. It requires sudo or equivalent elevation, asks interactive questions, and normally handles password, primary group, home directory, and default files together on Debian and Ubuntu.

adduser and useradd

adduser and useradd are related, but they are not guaranteed to behave identically on every Linux distribution.

useradd is the lower-level account-creation utility. Its options and defaults require more deliberate selection. Depending on the distribution and options, you may need to specify whether to create a home directory, which shell to use, which group to assign, and how other account properties should be initialized.

On Debian and Ubuntu, adduser is generally the preferred higher-level interactive frontend for ordinary local account creation because it follows distribution conventions and handles common setup tasks. On other systems, adduser may behave differently, or it may be a wrapper or link to useradd. Consult the local documentation before relying on a particular option set.

adduser: Higher-level; normally interactive; commonly creates the home directory, primary group, default files, and password as part of the normal Debian/Ubuntu workflow; preferred for routine Ubuntu/Debian desktop or server account creation.

useradd: Lower-level; often non-interactive; home-directory and other initialization behavior depends on options and distribution defaults; useful for controlled automation when the administrator explicitly specifies the required settings.

For advanced Debian or Ubuntu customization, review /etc/adduser.conf. It can define defaults such as user and group ID ranges and home-directory behavior.

Verify the new account

Verification should check existence, identity, groups, home-directory ownership, and password status without exposing password hashes.

Check that the account exists

getent passwd jwilliams

This queries the configured account databases and prints the account's metadata if it exists. The output normally includes the username, numeric user ID, primary group ID, comment field, home directory, and login shell. It does not display the password.

Inspect identity and group membership

id jwilliams

Look for the numeric user ID, the primary group, and any supplementary groups. Do not assume that an account is an administrator merely because it exists; inspect its group membership and the local privilege policy.

Check the home directory

ls -ld /home/jwilliams

The directory should normally exist for a standard desktop account created with normal defaults. Its owner should be the new user, and its permissions should prevent unrelated users from casually modifying personal files.

Check password status safely

sudo passwd -S jwilliams

This reports password status, such as whether the password is usable or locked, without printing the password or its hash. If a password must be set or reset:

sudo passwd jwilliams

Finally, test a local login or use su - jwilliams when appropriate. Check that the expected home directory and personal environment are available.

Common problems

The graphical add-user controls are unavailable

The User Accounts panel may still be locked, the current user may lack administrator rights, or an authentication prompt may have been canceled or failed. Unlock the panel with an authorized administrator credential, or ask a system administrator to perform the change.

The command fails with a permission error

The command may have been run without sudo, or the current account may not be authorized to use it. Run account-management commands through an authorized administrative account.

adduser says the user already exists

getent passwd jwilliams

The username may already be assigned locally or through another configured identity source. A previous attempt may also have created the account. Choose another username or modify the existing account rather than creating a duplicate.

The username is rejected

The name may contain spaces, uppercase characters, unsupported punctuation, or a reserved name. Use a concise lowercase name that follows the distribution and organization policy.

The new user cannot log in

A password may not have been set, may have been entered incorrectly, or may be locked. Set a new password and inspect its status:

sudo passwd jwilliams
sudo passwd -S jwilliams

Also verify that the intended login method is enabled and that the account was not disabled by a separate policy.

The account has no expected home directory

A lower-level creation command may have been used without the option to create a home directory, or local defaults may have changed. Review the creation method and distribution defaults, then create or repair the directory using your system's administrative procedures. Check /etc/adduser.conf when diagnosing Debian or Ubuntu adduser defaults.

Related account administration

Creating an account is one part of account administration. Related tasks include changing passwords, modifying account details, changing supplementary group membership, granting or revoking sudo privileges, and locking or unlocking accounts.

When someone no longer needs access, evaluate the account's files, scheduled work, ownership, and required records before disabling or deleting it. Locking an account can stop password authentication while preserving files for investigation or later transfer. Deleting an account may remove the identity while leaving or removing its home directory depending on the chosen administrative procedure.

Useful Linux administration references

For broader command-line context, see Linux, showing the full path of shell commands, and Bourne Again Shell (Bash).