Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to change the password that get's asked when doing sudo. I'm in Ubuntu. Doing 'sudo passwd' or 'sudo passwd root' does give me the two new password questions, and it successfully changes passwords. But then I can still use my old password when doing sudo again for something else. I do have a user with the exact same password, don't know if that makes a difference. I enabled root user, and I can see the new password does work with the root user.

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

How to change sudo password?

share|improve this question

migrated from stackoverflow.com Feb 27 '13 at 12:51

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 8 down vote accepted

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>
share|improve this answer
1  
And learn more about /etc/sudoers which configure the behavior of sudo –  Basile Starynkevitch Feb 25 '13 at 18:49
1  
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. –  user1494552 Feb 25 '13 at 19:02

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|improve this answer
    
thanks for responding, you were fast, but not fast enough for the point:), but thanks though –  user1494552 Feb 25 '13 at 19:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.