Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I force the passwd command to use MD5 hash and not to use crypt? I need to get the passwd command to talk to the ldap server (which it does) and use MD5 when I change passwords for the users.

share|improve this question
up vote 2 down vote accepted

Assuming Linux: set value of ENCRYPT_METHOD in /etc/login.defs to MD5.

share|improve this answer
MD5 (was and) is the choosen ENCRYPT_METHOD in /etc/login.defs - but passwd still makes {crypt} hashes in the LDAP-base. – MyOnlyEye May 14 '11 at 8:30
And it says pam_password md5 in ldap.conf... – MyOnlyEye May 14 '11 at 8:36
Try this:… the author reports a success. – Paweł Brodacki May 14 '11 at 8:48
This is beginning to annoy me... if I follow the tutorial pam_password exop gives me SSHA hashes - and if I change it back to pam_password md5 I get crypt hashes. WHY!? :-) – MyOnlyEye May 14 '11 at 10:16
"pam_password exop" in /etc/ldap.conf makes passwd use the password policy from the ldap server (in my case SSHA). I changed the policy in the server to MD5 and it worked. Now changes password with passwd is made with the MD5 hash - and I can happily sync all my users (and passwords) with Google Apps! – MyOnlyEye May 14 '11 at 13:35

Set the following in your /etc/login.defs file:

share|improve this answer

You can also use the authconfig command like so:

authconfig --enablemd5

Just search in the man page.

share|improve this answer

Your Answer


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.