Table of Contents >> Show >> Hide
- What the Error Usually Means
- 1. Make Sure You Are Entering the Right Password
- 2. Remember That Ubuntu Hides Password Input Completely
- 3. Check for Caps Lock, Num Lock, and Keyboard Layout Problems
- 4. Confirm That Your Account Actually Has Sudo Privileges
- 5. Reset Your Password from a Working Session
- 6. Force Sudo to Prompt Freshly
- 7. Reset the Password from Recovery Mode
- 8. Look for Account Locks or Password Status Problems
- 9. Check for PAM, Sudoers, or Shadow File Damage
- 10. Try a Simpler Password Temporarily
- 11. Prevent the Error from Coming Back
- Real-World Experiences with the “Incorrect Password …Try Again” Error
- Conclusion
- SEO Tags
Few things make an Ubuntu user question reality faster than typing a password you know is correct, only to get smacked with the classic message: “Sorry, try again” or “incorrect password”. It feels personal. It feels rude. And sometimes it feels like your keyboard has joined a rebellion.
The good news is that this error is usually fixable. In many cases, nothing is actually broken. Ubuntu may be rejecting the password because you are entering the wrong account password, using the wrong keyboard layout, trying to use sudo without the right privileges, or dealing with a password database or PAM issue. In more dramatic cases, you may need recovery mode or a live USB to get back in and reset things properly.
This guide walks through the most common causes and the most reliable fixes, from simple checks to recovery-level repairs. Whether Ubuntu is refusing your password in Terminal, Software Updater, or a login prompt, here is how to solve the problem without yelling at the monitor. Or at least not only yelling at the monitor.
What the Error Usually Means
In Ubuntu, the “incorrect password … try again” error does not always mean your password is objectively wrong. It means the system could not validate the password in that context. That distinction matters.
For example, sudo usually asks for your own user password, not the root password. Ubuntu also hides password input in Terminal, so it can look like nothing is being typed even when it is. On top of that, a changed keyboard layout, a missing sudo group assignment, a locked account, or broken authentication files can all trigger the same frustrating message.
So before you assume Ubuntu has become sentient and vindictive, start with the basics.
1. Make Sure You Are Entering the Right Password
This is the most common fix, and yes, it deserves to be first. On Ubuntu, sudo normally asks for the password of the current logged-in user. It does not ask for the root password in the standard Ubuntu setup.
That means if you are logged in as alex and you run a command like sudo apt update, Ubuntu expects Alex’s password. If you enter a root password, an old password, or the password for a different user account, Ubuntu will reject it every time.
To double-check who you are logged in as, run:
If the result is not the account you expected, mystery solved. Use the password for the displayed user.
2. Remember That Ubuntu Hides Password Input Completely
Here is one of Linux’s oldest magic tricks: when you type a password in Terminal, Ubuntu shows nothing. No dots. No stars. No comforting little bullets. Just empty silence.
That silence is normal.
So if you run:
and then start typing, your password is still being entered even though the screen looks frozen and judgmental. Type the password carefully and press Enter.
If you panic, mash backspace twelve times, and retype with rising emotional intensity, you may end up entering the wrong thing. Calm fingers win here.
3. Check for Caps Lock, Num Lock, and Keyboard Layout Problems
If your password works in one place but not another, your keyboard layout may be the real villain. This is especially common after updates, on dual-language systems, on laptops with Fn key weirdness, or when the login screen uses a different layout than your desktop session.
Common signs include:
- Your password works in the GUI but fails in Terminal.
- Your password contains symbols like
@,#,!, or punctuation. - The problem started after switching keyboard languages or layouts.
- Caps Lock is quietly doing chaos behind the scenes.
Try these checks:
- Turn Caps Lock off and type slowly.
- Test the same characters in a plain text field without revealing your real password.
- Switch to a simple temporary password later if special characters seem to be causing trouble.
- Verify the selected keyboard layout on the login screen if the error happens before you reach the desktop.
If you suspect the password itself is fine but the layout is wrong, changing the password temporarily to something simple like a strong passphrase using only letters and numbers can be an effective diagnostic move.
4. Confirm That Your Account Actually Has Sudo Privileges
Sometimes the password is correct, but the user account is not allowed to run sudo. Ubuntu’s first user is usually added to the sudo group during installation, but that can change if accounts were modified later, imported, restored, or manually edited.
Check your groups with:
If you do not see sudo in the output, your account may not have administrative privileges. In that case, the fix is not “type harder.” The fix is to add the user back to the proper group from another admin account, recovery mode, or a live session.
From an account that already has administrative access, the command is usually:
Or on Ubuntu, this also works:
After that, log out and log back in so the new group membership takes effect.
5. Reset Your Password from a Working Session
If you are still logged in graphically but Terminal authentication is failing, try changing the password from the account itself.
To change your own password, run:
You will be asked for your current password, then the new one twice.
If you have access to another administrator account, you can reset a user password directly:
This is often the fastest fix when the old password is corrupted, mistyped in memory, or affected by layout issues. Pick a strong password you can enter reliably in both GUI and Terminal. In other words, do not create a password so “secure” that even you cannot reproduce it.
6. Force Sudo to Prompt Freshly
Ubuntu caches successful sudo authentication for a short period. Usually that is helpful. Occasionally it muddies the waters when you are testing whether a password change worked or whether a failed attempt is still being remembered in the current session.
Reset the current sudo timestamp with:
Then test authentication again with:
If the password is now accepted, your account is probably fine and the issue was session-related. If it still fails, keep moving down the checklist.
7. Reset the Password from Recovery Mode
If you cannot authenticate normally at all, recovery mode is the classic Ubuntu rescue route. It is not glamorous, but it gets the job done.
Basic recovery approach
- Reboot the machine.
- Open the GRUB menu by holding
Shifton BIOS systems or tappingEscon many UEFI systems. - Select the recovery option for your Ubuntu kernel.
- Choose the root shell option if available.
- If the filesystem is mounted read-only, remount it as writable:
- Reset the password:
- Reboot and log in with the new password.
This method is especially useful when you forgot the password entirely or got locked out of your normal admin path.
If recovery mode does not cooperate
If the built-in recovery route fails, boot from an Ubuntu live USB, mount the installed system, and chroot into it. That lets you work on the installed system from a rescue environment and reset the password or restore group membership there.
A typical pattern looks like this:
Replace /dev/sdXN with your actual Linux root partition. If you are not sure which partition that is, inspect the drive layout first.
8. Look for Account Locks or Password Status Problems
If the account was locked manually or by policy, correct passwords can still fail. This is more common on managed systems, enterprise laptops, or systems using additional PAM rules.
You can inspect password status with:
If the account is locked, you may need to unlock it:
Be careful here. If you are on a company-managed or school-managed machine, authentication may be tied to LDAP, Active Directory, SSSD, or another external identity source. In that case, the Ubuntu box may not be the real source of truth, and local fixes will only go so far.
9. Check for PAM, Sudoers, or Shadow File Damage
This is where the issue stops being a typo and starts being a system problem. If you recently edited authentication files, restored from backup, changed permissions, installed a custom PAM module, or “cleaned up” something in /etc with too much confidence, Ubuntu may no longer be able to validate passwords correctly.
Pay special attention to these areas:
/etc/pam.d/for broken PAM rules/etc/sudoersand/etc/sudoers.d/for invalid sudo configuration/etc/passwdand/etc/shadowif permissions or contents were altered- SSSD or external authentication services if this is a domain-joined system
Important rule: do not casually hand-edit authentication files unless you know exactly what you are doing. A single bad change can break logins, sudo, or both.
If you suspect sudoers is the issue, validate edits with:
Do not use a plain text editor directly on /etc/sudoers. That is how small mistakes become very long afternoons.
10. Try a Simpler Password Temporarily
This is not a forever fix, but it is a smart troubleshooting step. If your current password includes unusual symbols, accented characters, or characters that move around between layouts, set a temporary strong password that uses only reliable characters you can reproduce easily.
For example, a passphrase made of several random words plus numbers is both easier to type and easier to verify during troubleshooting. Once everything works again, you can decide whether to keep it or change it to another secure option.
And yes, this is one of those moments where a practical password beats an “elegant” one with four keyboard gymnastics moves.
11. Prevent the Error from Coming Back
Once you fix the issue, do yourself a favor and reduce the chance of a sequel.
- Keep at least one admin account in the
sudogroup. - Do not remove yourself from
sudobefore confirming another admin path works. - Avoid editing PAM, shadow, or sudoers files casually.
- Use
visudofor sudo changes. - Keep a live USB available for emergency recovery.
- Use a password manager so you are not relying on memory plus vibes.
- After changing keyboard layouts, verify login and terminal input behavior.
Real-World Experiences with the “Incorrect Password …Try Again” Error
In real life, this Ubuntu error usually shows up in patterns. One of the most common is the “but I can log in, so why does sudo hate me?” scenario. A user signs into the desktop perfectly fine, opens Terminal, runs sudo apt upgrade, and suddenly gets told the password is wrong. After ten increasingly offended attempts, the cause turns out to be simple: they were entering the root password they used on a different Linux machine, not the password for the current Ubuntu user. Ubuntu was not confused. The human was running on autopilot.
Another very common experience is the invisible typing panic. Newer users often assume the keyboard has stopped working because the cursor does not move and no characters appear while entering the password. Then they type half the password, stop, backspace randomly, type again, and end up sending a digital ransom note instead of the correct credential. Once they learn that Ubuntu intentionally hides password input, the problem disappears in about five seconds.
Then there is the keyboard-layout ambush. This one is sneaky. Everything looks normal, but a laptop boots with a different input layout on the login screen or inside a virtual console. Suddenly, a character like @ or " is no longer where muscle memory expects it. The user swears the password is correct, and honestly, they are not wrong in spirit. Their fingers are entering the password they intended, just not the one Ubuntu is receiving. Changing to a temporary password with plain letters and numbers often reveals the problem immediately.
A more painful experience happens after someone experiments with permissions or account settings. They remove themselves from the sudo group, edit /etc/sudoers directly, or restore old configuration files from backup without checking compatibility. Everything seems fine right up until the moment administrative access is needed. At that point, Ubuntu stops being helpful and starts being extremely literal. No valid sudo policy, no privileged access. That is usually when recovery mode enters the chat.
On managed systems, the experience can be even stranger. A person changes their password through a company portal, waits a bit, and finds that desktop login works but terminal elevation does not. Or the opposite. In those cases, local Ubuntu is only one part of the chain. SSSD, LDAP, AD integration, or a PAM policy may be involved, and the machine may be waiting for credentials to sync or may be using a broken auth rule. That kind of failure feels random from the user’s perspective, but the fix is often in the authentication backend, not the password itself.
The biggest lesson from all these experiences is simple: this error is usually not solved by trying the same password harder. It is solved by checking context. Which user are you? Which password is being requested? Which layout is active? Does the account have sudo rights? Did anything in PAM, shadow, or sudoers change? Once you ask those questions, the problem usually shrinks from “Ubuntu is broken” to “oh wow, that was the issue?” In the Linux world, that little moment of embarrassment is practically a rite of passage.
Conclusion
If Ubuntu keeps throwing the “incorrect password … try again” message, start simple and move methodically. First confirm that you are using the password for the current user, not root. Then rule out invisible terminal input confusion, keyboard layout issues, and missing sudo privileges. If needed, change the password with passwd, reset access in recovery mode, or repair broken authentication settings.
Most importantly, do not make the problem worse by randomly editing /etc/passwd, /etc/shadow, or /etc/sudoers in a hurry. Ubuntu authentication is sturdy, but it rewards careful fixes and punishes creative chaos. A calm checklist beats panic every time.
