LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Export from mysql to ldap - encrypted passwords (http://www.linuxquestions.org/questions/linux-server-73/export-from-mysql-to-ldap-encrypted-passwords-732043/)

clau_bolson 06-10-2009 05:05 PM

Export from mysql to ldap - encrypted passwords
 
Hi,
I am setting up a new mail server.
I have a working mail server using mysql, our advisor told us that ldap would be a better choice for the new server, so it's all set up and working now.
I have to export the accounts. I will make a php script that will read from mysql and record to ldap - easy.
But I don't know how to convert passwords. For the accounts I have created so far in ldap server, I used slappasswd and copied the resulting string. I've chosen {CRYPT}. Dovecot has no trouble reading them.
In mysql passwords were generated using its encrypt() function.
I guess, if I copy them straight, it won't work.

What should I do?

Thanks.

archangel_617b 06-11-2009 01:45 PM

Quote:

Originally Posted by clau_bolson (Post 3569714)
Hi,
I am setting up a new mail server.
I have a working mail server using mysql, our advisor told us that ldap would be a better choice for the new server, so it's all set up and working now.
I have to export the accounts. I will make a php script that will read from mysql and record to ldap - easy.
But I don't know how to convert passwords. For the accounts I have created so far in ldap server, I used slappasswd and copied the resulting string. I've chosen {CRYPT}. Dovecot has no trouble reading them.
In mysql passwords were generated using its encrypt() function.
I guess, if I copy them straight, it won't work.

What should I do?

Thanks.

You've got passwords that have already been encrypted using this function:

http://dev.mysql.com/doc/refman/5.1/...nction_encrypt

And you're trying to store them in LDAP as CRYPT passwords, right?

http://www.openldap.org/faq/data/cache/344.html


This should work, but I'm a little confused. Can you please clarify more info about your dovecot + SQL / LDAP setup(s)?

When you say "I used slappasswd and copied the resulting string. I've chosen {CRYPT}. Dovecot has no trouble reading them." ... Dovecot shouldn't be reading the passwords out of the LDAP directory. It should be passing authentication attempt through to it.

- Arch


All times are GMT -5. The time now is 10:41 AM.