54

I receive this message when trying to change my password:

"Bad: new and old password are too similar"

The passwords' "similarity" is irrelevant for my needs, so I'd like to bypass this.

I tried sudo passwd $my_username

I thought this had worked because I got a message:

passwd: password updated successfully

However, the password change has no effect after leaving the terminal, and my old password is still the only one recognized.

Any ideas?

thanks

user999
  • 541
  • The result shows that your password has been updated sucessfully. Just logout and login back to confirm. – karthick87 May 21 '11 at 14:10
  • I've logged out and back in, and rebooted my machine. No effect - the old password remains. – user999 May 21 '11 at 14:14
  • 1
    What version of ubuntu you are using? Try changing the user password using GUI method. – karthick87 May 21 '11 at 14:18
  • Thanks for your help. Using 11.04. Unfortunately, the GUI method doesn't allow a 'similar' password. If what I've done above is seemingly correct, then I'll just need to choose a different type of password. I'm just surprised the sudo method isn't working for me. – user999 May 21 '11 at 14:30
  • @user999 maybe a stupid question on my part but did you actually use $my_username or did you change that to your username? – Rinzwind May 21 '11 at 14:36
  • @Rinzwind yes, i used my own username :) – user999 May 21 '11 at 14:46
  • 1
    @user999 I can even change my password without it nagging about it being too short (used 1 letter to test ;)) or it being the same as used before or even being the same password as it already is. – Rinzwind May 21 '11 at 14:52
  • @Rinzwind I see, and you're typing exactly as I've done above? thanks – user999 May 21 '11 at 14:55
  • @user999 Yes I did. – Rinzwind May 21 '11 at 14:57
  • Okay, I tried once more with sudo command line, but this time chose a completely different, not similar, password. This still didn't work. I then attempted to change my password to a non-similar one with the GUI tool. This has worked. Haven't solved the original problem of wanting a similar password, but at least i've finally managed to change my password. Happy to move on now with the rest of the day... thanks for your help. – user999 May 21 '11 at 15:14

4 Answers4

62

For me I was able to avoid this message:

Bad: new password is just a wrapped version of the old one (and a few other similar messages)

by running $sudo passwd <my_username> instead of just $ passwd

Just obviously be aware of the security implications but at least it allows it now.

23

A workaround would be to change the old password to a random one, and change it again to a similar one. The password history is not preserved, so this should work fine.

If you need a real solution, please include the contents of your /etc/pam.d/common-password and /etc/pam.d/chpasswd (preferably using a pastebin).

Alaa Ali
  • 31,535
Adam Byrtek
  • 9,811
  • If using the workaround, remember that there are other limitations to be aware of in more recent versions of Ubuntu. "New password is too simple" and "You must choose a longer password" are just two. – Kelly Bang Feb 26 '17 at 06:23
  • 1
    also, note that some systems are configured to not let you change the password more than once a day, in order to avoid exactly this (stupid corporate rules). So make sure you save that temporary password well – Ciprian Tomoiagă Dec 19 '19 at 13:55
3

sudo chage -l username

  • Use this command to view your current password expiration policies.

sudo chage username

  • Use this to get change the different password expiration policy fields; set Minimum Password Age to 0 and set Maximum Password Age to 99999 to keep your current password indefinitely and don't want it to expire.

More info: Ubuntu Server Guide - Ubuntu User Management: Password Expiration

Alaa Ali
  • 31,535
13east
  • 1,945
1

https://help.ubuntu.com/12.04/serverguide/user-management.html doesn't seem to list the relevant options - it mentions /etc/pam.d/common-password but without details of what precisely is meant by rule-sets like nullok_secure or what other rule-sets are available.

Mentioning a document like man pam_unix might be useful here?

OJW
  • 61
  • 4
    Hi OJW! Your post doesn't seem to attempt to answer the question. Did you mean this as a comment to 13east's answer? – Alaa Ali Aug 20 '13 at 12:33