How to Fix the “sudo Password Not Working” Error on Linux

Sometimes, your Linux system may throw an incorrect password error even after typing in the correct sudo password. This can be both surprising and annoying when you’re trying to get stuff done.

Let’s look at a few quick fixes you can try when your correct sudo password does not work on Linux.

1. Log Out and Log Into a New Session

regular user on ubuntu logging in

Restarting your Linux system is one of the most popular and easy solutions to fixing any temporary system glitches. The sudo password not working error is, in the best case scenario, just a temporary glitch within Linux that should be magically fixed by simply doing a quick logout-login or a system reboot.


You can manually log out and log back into your Linux system either using the logout command or by using the corresponding buttons on the desktop environment you’re running.

In case that doesn’t work for you, simply perform a reboot by typing reboot. Still not fixed? Move on to the next solution!

2. Change the sudo Password From a Virtual Console Session

Linux console mouse text selection

If the first, and easiest solution did not quite do the job for you, you can try resetting the sudo password for the user from a Linux virtual console session. Here are the steps to follow:

  1. Switch to a new virtual console session by pressing Ctrl + Alt + F1/F2/F3/F4. You should be greeted by a new TTYx session.
  2. Switch to the root user with the sudo su command.
  3. Using the passwd command, change the sudo password for the user:
     passwd username 

That’s all the steps required to fix the correct sudo password not working for your user. Your problem should now be fixed. In case the issue persists, try the last solution.

3. Restart the systemd-homed Service

using systemctl to start systemd-homed service

systemd-homed is a core systemd service responsible for providing support to the home directories of users. Restarting it may fix the issue because it resets the authentication mechanism and potentially fixes any temporary system glitches.

Here are the steps to restart the systemd-homed service:

  1. Fire up a new terminal.
  2. Switch to root using the sudo su command.
  3. Use the systemctl command to start or restart the systemd-homed service:
     systemctl start systemd-homed.service
    systemctl restart systemd-homed.service

That’s all the steps required to start and restart the systemd-homed service. This should finally fix the sudo password not working issue for you.

Fixing the “sudo Password Not Working” Error

Although it’s an annoying issue, it’s quite easy to resolve. Either of the three provided solutions is bound to fix the sudo password not working problem.

If you still can’t seem to get it working or, often have to deal with sudo’s time-consuming and work-disrupting antics, it might be time to switch to a better alternative.


🧪 |Medical Laboratory Scientist 🥇 | Mindset over Everything. 
 🤝 | Let's Grow Together.

Related Articles

Back to top button