Apache crypt to SHA or standard Unix crypt

Leah Cunningham leah-8JrgHtYBq2OWVfeAwA7xHQ at public.gmane.org
Wed Oct 12 22:56:46 UTC 2005


I have a strange problem that I am hoping for comments on.  I am trying
to migrate a bunch of Apache users from a htpasswd file over to LDAP
accounts.  I have a script that will do what I want for me, however,
what I have been discovering is that the crypt that is used for Apache
password files is specific and appears to not be 100% compatible with
standard unix crypted passwords.  I am therefore trying to find a clean
way to somehow convert a bunch of Apache crypted passwords to standard
Unix crypt format, or even MD5 or SHA.

Any clue where I would start?  Doing a crypt like this works fine for
LDAP in perl:

 my($cpass) = crypt "$pass",(join '', ('.', '/', 0..9,
'A'..'Z','a'..'z')[rand 64, rand 64]);

-- 
Leah Cunningham : d416-585-9971x692 : d416-703-5977 : m416-559-6511
Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list