Changing root password does not change sudo password

65,057

Solution 1

You're changing root's password. sudo wants your user's password.

To change it, try plain passwd, without arguments or running it through sudo.

Alternately, you can issue:

$ sudo passwd <your username>

Solution 2

The password you use for sudo is the password of your own account, not the root account. sudo is used to grant you access to commands that need to be executed as root without giving you root access directly. To change your own password, use passwd without sudo.

Share:
65,057

Related videos on Youtube

Anthony Geoghegan
Author by

Anthony Geoghegan

Updated on September 18, 2022

Comments

  • Anthony Geoghegan
    Anthony Geoghegan over 1 year

    I’m trying to change the password that is asked when running sudo in Ubuntu. Running sudo passwd or sudo passwd root does give me the two new password prompts and it successfully changes the password.

    But then I can still use my old password when running sudo again for something else. I do have a user with the exact same password but I don’t know if that makes a difference. I enabled the root user and I can see the new password does work with the root user account.

    So the root password is changed but not the password for sudo.

    How do I change the sudo password?

    • Admin
      Admin almost 8 years
      root password is used by su, it is your password that is used by sudo.
  • cheesesticksricepuck
    cheesesticksricepuck about 11 years
    And learn more about /etc/sudoers which configure the behavior of sudo
  • cheesesticksricepuck
    cheesesticksricepuck about 11 years
    You are right, I see it asks the user password, that was not so smart of me. So what I need to do is remove the user from the soduers/admin group.
  • Peque
    Peque about 11 years
    thanks for responding, you were fast, but not fast enough for the point:), but thanks though