Finding Your Ubuntu Username

Your Ubuntu username is the account name you created when you first set up the system, or the one your administrator gave you. The fastest way to see it is to open a terminal and type whoami, then press Enter. The name that appears is your current username.

If you are already logged in to the desktop, you can also find it by clicking the power icon in the top-right corner. Your username appears at the top of the menu that opens. On older Ubuntu versions, look for "About Me" in the system settings — your username is listed there under "User Accounts".

If you have multiple user accounts on the machine and need to see all of them, open a terminal and type cat /etc/passwd. Each line shows one account. The username is the first part before the colon. System accounts (like root, daemon, and www-data) will appear in this list too, but your personal account is the one you use to log in.

Key Takeaways

  • Type whoami in a terminal to see the username of the account you are currently using.
  • Your password is not stored anywhere you can read it back — Ubuntu stores only a scrambled version for security reasons.
  • If you forget your password, you can reset it by booting into recovery mode or using another administrator account on the same machine.
  • Never share your password with anyone, and change it if you think someone else knows it.

Why You Cannot Find Your Password

Ubuntu does not store passwords in a way that lets you read them back. When you create a password, Ubuntu scrambles it using a one-way process called hashing. Even the system administrator cannot see your actual password — they can only verify that the password you type matches the scrambled version stored on disk.

This is intentional and protects you. If someone broke into the computer and stole the password file, they would see only the scrambled versions, not the real passwords. If Ubuntu stored passwords in plain text, a breach would expose every account at once.

Resetting a Forgotten Password

If you forget your Ubuntu password, the recovery method depends on whether you have physical access to the machine and whether another administrator account exists on it.

The simplest path is to use another administrator account. Log in with that account, open a terminal, and type sudo passwd username (replace "username" with the account that needs resetting). Type the password of the current administrator account when prompted, then enter the new password twice. The next time you log in with the forgotten account, use the new password.

If no other administrator account exists, you will need to boot into recovery mode. Restart the machine and hold Shift while it boots to open the GRUB menu. Select "Advanced options for Ubuntu", then choose the recovery mode entry. From the recovery menu, select "Drop to root shell prompt". Type mount -o remount,rw / to make the filesystem writable, then passwd username to reset the password. Type the new password twice and reboot normally.

Changing Your Password Regularly

You can change your own password anytime without needing administrator permission. Open a terminal and type passwd, then press Enter. Ubuntu will ask for your current password first, then prompt you to enter the new password twice.

Choose a password that is at least 12 characters long and mixes uppercase letters, lowercase letters, numbers, and symbols. Avoid passwords based on dictionary words, your name, your username, or information someone could guess from your social media. If you use the same password on multiple systems, change it on all of them if one system is compromised.

Viewing Your Username in System Settings

On Ubuntu 22.04 and newer, click the power icon in the top-right corner and your username appears at the top of the menu. On Ubuntu 20.04 and earlier, open Settings from the Activities menu, select "About", and look for "User Accounts". Your username is listed there.

You can also change your account name from this screen, though the login username (the one you type at the login prompt) stays the same. The display name is what appears in the menu and in file ownership — changing it does not affect your password or login process.

Understanding the Difference Between Username and Display Name

Ubuntu actually tracks two different names for each account. The username (or login name) is what you type at the login prompt — it is usually lowercase with no spaces, like "sarah" or "marcus.chen". The display name is what appears in menus and system settings — it can have spaces and capitals, like "Sarah Johnson".

When you type whoami in a terminal, you see the username, not the display name. When you reset a password with passwd, you are resetting it for the username. If you change the display name in Settings, your username and password do not change.

Checking Your User Account Type

Ubuntu accounts come in two types: administrator (also called sudo user) and standard user. An administrator account can install software, change system settings, and reset other users' passwords. A standard account cannot.

To check your account type, open a terminal and type sudo -l. If you are an administrator, Ubuntu will ask for your password and then show a list of commands you can run with sudo. If you are a standard user, you will see a message saying you are not in the sudoers file.

If you need administrator permissions and do not have them, ask someone with an administrator account to add you. They can do this by opening Settings, selecting "Users", clicking the lock icon to unlock it, selecting your account, and changing the "Administrator" toggle to on.

Frequently Asked Questions

Can I see my password if I type it in the terminal?

No. When you type a password in a terminal or login prompt, Ubuntu hides it — you will not see dots, asterisks, or any characters appear. This is a security feature. Type your password carefully and press Enter when done.

What if I type my username wrong at the login screen?

Ubuntu will show an error message saying the login failed. Check that you typed the username correctly — it is case-sensitive, so "Sarah" and "sarah" are different. If you are not sure of the exact spelling, restart the machine and try again, or use another account to check the username with the methods described above.

Is my password stored in a file I can edit?

No. Passwords are stored in /etc/shadow, a file that only the root user can read. Even if you could read it, you would see only the scrambled version, not the actual password. Editing this file directly is not a safe way to reset a password — use the passwd command instead.

Can I log in without a password?

You can set up passwordless login using SSH keys or biometric authentication, but this requires administrator access and additional setup. For a standard login at the desktop, Ubuntu requires a password. If you want to skip the password prompt on your own machine, you can disable it in Settings under "Users", but this reduces security.

What should I do if someone else knows my password?

Change it when ready by opening a terminal and typing passwd. Choose a completely new password that is different from any you have used before. If the person who knows your password also has access to your email account, change your email password too, because many services use email to reset passwords.