21

I am trying to change my current password in Red Hat Enterprise Linux Server release 5.10 (Tikanga) but it says my new password is too similar. Is there any way to force change ?

$ passwd
Changing password for user XY
Changing password for XY
(current) UNIX password:
New UNIX password:
BAD PASSWORD: is too similar to the old one
New UNIX password:
  • Duplicate: superuser.com/questions/130922/… – darnir Sep 17 '14 at 8:06
  • I did not want to change to same password. let say I have Bilbo1 and I want to change to Bilbo2, I get message above: "BAD PASSWORD: is too similar to the old one"... SO I am not changing to same password – To Kra Sep 17 '14 at 11:56
  • If you had bothered to read the answers to that question, you'd have realized why you're in the same position and how to resolve your problem. – darnir Sep 18 '14 at 9:18
  • 2
    IMHO that mentioned question has no really clear answer. – To Kra Sep 19 '14 at 9:59
  • @darnir, duplicates are when the question is already asked in same SO site. This one can not be a duplicate :) – Ramesh Sep 19 '14 at 16:18
23

If you can run the command as root, you can force the change to be accepted.

Example:

$ sudo passwd myusername
Changing password for user myusername.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
  • This is the perfect answer – Jadda Oct 3 '18 at 19:03
  • Works with still warnings. – Sandburg Apr 30 at 15:58
7

Short answer: You can't.

work around:

  • change twice, e.g. old passwd is Bilbo1,

    • change to Frodo1 (from Bilbo1),

    • then change to Bilbo2 (from Frodo1).

why two changes ?

  • on the first change, Linux can only compare clear text Bilbo1 and Frodo1,

  • on second Linux can only compare Frodo1 and Bilbo2 (and all the crypted passwd, you can't revert to Bilbo1(*)).

  • This suppose you can change twice, which may have been disable by your system admin, to prevent such work arround.

Needless to say, do not use such a silly password.

(*) On second tought, I am not sure about this point in Linux.

  • I did not want to change to same password. let say I have Bilbo1 and I want to change to Bilbo2, I get message above: "BAD PASSWORD: is too similar to the old one"... SO I am not changing to same password – To Kra Sep 17 '14 at 11:57
  • Well, did yo umanaged to change from Bilbo1 to Bilbo2 using Frodo1 between ? – Archemar Sep 17 '14 at 12:24
  • 4
    well, while trying change from Frodo1 to Bilbo2 I got message that: "You must wait longer to change your password" LOL – To Kra Sep 18 '14 at 8:29
  • that was my third point. my favourite password pattern is Bilbo00 / Frodo00 with 00 the current month. – Archemar Sep 18 '14 at 8:34
  • normally I use pattern: bilbo0000BAGGINS – To Kra Sep 18 '14 at 8:42
2

You can also use the -f option.

$passwd -f username
Changing password for user username.
New password: 
Retype new password:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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