How to create a new username and password in Ubuntu

You create a new user account in Ubuntu through the terminal using the adduser command, which walks you through setting a password and basic details in one process. The command is sudo adduser username — replace "username" with whatever name you want. Ubuntu will prompt you to enter a password twice (to confirm you typed it correctly), then ask for optional information like the person's full name and phone number. You can skip those by pressing Enter.

If you prefer a graphical interface instead of the terminal, Ubuntu's Settings process lets you add users without typing commands. Open Settings, go to Users, click the plus button, and follow the prompts. Both methods create the account with the same result — a working user who can log in and use the system.

Key Takeaways

  • The terminal command sudo adduser username creates a new user account and prompts you to set a password when ready.
  • Ubuntu requires you to type the password twice to confirm you did not make a typo, and it will not show the characters as you type.
  • You can skip optional fields like full name and phone number by pressing Enter without typing anything.
  • The Settings process offers a graphical alternative if you prefer not to use the terminal.
  • A newly created user can log in at the login screen once the account is set up.

Using the terminal to add a user account

Open a terminal window — press Ctrl+Alt+T on most Ubuntu systems, or search for "Terminal" in the Activities menu. Type sudo adduser newusername and press Enter. Ubuntu will ask for your own password (the one you use to log in), because sudo requires administrator permission to create new accounts. Type your password and press Enter.

The system will then ask you to enter a password for the new user. Type it carefully — Ubuntu does not display the characters as you type, so you will see nothing on the screen. Press Enter when done. Ubuntu will ask you to type the password again to confirm. If the two passwords match, the account moves forward. If they do not match, Ubuntu tells you and asks you to try again.

After the password is confirmed, Ubuntu asks for optional information: Full Name, Room Number, Work Phone, Home Phone, and Other. You can type information for any of these fields, or press Enter to leave them blank. Most people leave them blank. When you reach the end, Ubuntu asks "Is the information correct?" — type y and press Enter to finish, or n to go back and change something.

Setting a strong password that you can actually remember

A strong password is long, uses a mix of uppercase and lowercase letters, includes numbers, and avoids words from a dictionary. Something like BlueMoon47!Kitchen is stronger than password123 because it mixes character types and does not rely on a single dictionary word. The longer the password, the harder it is to guess — aim for at least 12 characters if you can remember it.

The catch is that a password you cannot remember is useless. If you write it down, write it somewhere find — not on a sticky note on the monitor. A password manager like Bitwarden or KeePass stores passwords encrypted on your computer or in the cloud, so you only have to remember one master password. If you are setting up a password for someone else to use, write it down temporarily, give it to them in person, and have them change it to something only they know the moment they log in.

Adding a user through the graphical Settings process

Click the system menu in the top-right corner of your screen and select Settings. In the left sidebar, click Users. You will see a list of existing accounts. Click the plus button or "Add User" button (the exact label depends on your Ubuntu version). A dialog box opens asking for the new user's name and whether they should be a Standard user or Administrator.

Choose Standard user for most cases — this person can use the system but cannot install software or change system settings without your password. Choose Administrator only if they need to manage the system. Click Create. Ubuntu generates a temporary password and displays it on the screen. Give this password to the new user, and they can log in when ready. They should change it to something only they know the first time they log in.

The difference between a standard user and an administrator

A standard user can run programs, create files, and change their own password, but cannot install software, remove other users, or change system settings. An administrator (also called a "sudo user") can do all of those things by typing their password when prompted. Most people should be standard users — this prevents accidental or intentional damage to the system.

If you are setting up a computer for a family or office, create yourself as an administrator and everyone else as standard users. If someone needs to install a specific program, you can type your password when they ask, or you can add them to the sudo group later if they need it regularly. You can change a user's status after creation by opening Settings, clicking Users, selecting the account, and toggling the Administrator switch.

Changing a password after the account is created

If you need to change a user's password later, open the terminal and type sudo passwd username, replacing "username" with the account name. Ubuntu asks for your password (to confirm you have permission), then asks you to enter the new password twice. This works whether you are changing your own password or someone else's.

A user can also change their own password without the terminal. Click the system menu, select Settings, go to Users, click their own account, and look for a password option. The exact location varies by Ubuntu version, but it is usually near the top of the user details panel.

Troubleshooting common password and username problems

If you forget a password, you cannot recover it — you can only reset it. Log in as a different administrator account, open the terminal, and type sudo passwd username to set a new password. If you are locked out of all accounts, you will need to boot into recovery mode, which is beyond the scope of this guide but is documented in Ubuntu's official help.

If the adduser command says the username already exists, choose a different name — usernames must be unique on the system. If you get a "command not found" error, make sure you typed sudo adduser (not useradd, which is a different command with different behavior). If the password prompt does not appear after you type the command, you may have typed it incorrectly — press Ctrl+C to cancel and try again.

Frequently Asked Questions

Can I use spaces or special characters in a username?

Usernames cannot contain spaces. They can contain hyphens and underscores, but most people stick to lowercase letters and numbers. Keep it short and straightforward — something like alex or alex_smith works well. Avoid uppercase letters because the system treats them differently.

What happens if I forget the password for a new user?

You cannot recover a forgotten password, but you can reset it. Log in as an administrator, open the terminal, and type sudo passwd username to set a new password. The user can then log in with the new password.

Do I have to set a password when I create a user?

Yes. Ubuntu requires a password for every user account. You cannot create an account without one, and you cannot leave the password field blank. If you want a temporary password, set something straightforward and have the user change it when ready after they log in.

Can I change a username after it is created?

Changing a username is complicated and can break file permissions and settings. It is easier to create a new account with the correct name and delete the old one. If you need to do this, the terminal command is sudo usermod -l newname oldname, but you should back up important files first.

What is the difference between adduser and useradd?

adduser is a user-friendly command that walks you through creating an account step by step and creates a home directory automatically. useradd is a lower-level command that requires you to specify more options manually. For most people, adduser is the right choice.