[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE: How do I copy a user password from one server to another using tools provided in OpenLDAP Software
- To: "Latte Coffee" <lattecafe@gmail.com>, <openldap-software@OpenLDAP.org>
- Subject: RE: How do I copy a user password from one server to another using tools provided in OpenLDAP Software
- From: "Mark Mcdonald" <mmcdonald@staff.iinet.net.au>
- Date: Mon, 14 Aug 2006 10:27:44 +0800
- Content-class: urn:content-classes:message
- Thread-index: Aca921cd5KUdv41vQjyUR3XE6iL0DwBbVOQg
- Thread-topic: How do I copy a user password from one server to another using tools provided in OpenLDAP Software
This is a fairly trivial task... Here's a simple bash script that would achieve your desired results, although I would recommend writing your own tool in a more sophisticated language such as perl as this is hardly foolproof or all-encompassing.
#!/bin/bash
SRCHOST='127.0.0.1'
DSTHOST='1.2.3.4'
SRCUSER='cn=read_user,o=org'
SRCPASS='source_password'
DSTUSER='cn=root_or_write_dn,o=org'
DSTPASS='write_password'
COPY='cn=dn_of_user_to_copy,o=org'
ATTR='userPassword'
LINE=$(ldapsearch -h $SRCHOST -D $SRCUSER -w $SRCPASS -x -b $COPY $ATTR |grep "^$ATTR:")
ldapmodify -h $DSTHOST -D $DSTUSER -w $DSTPASS -x <<-EOF
dn: $COPY
replace: $ATTR
$LINE
EOF
> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org [mailto:owner-openldap-
> software@OpenLDAP.org] On Behalf Of Latte Coffee
> Sent: Saturday, August 12, 2006 2:25 PM
> To: openldap-software@OpenLDAP.org
> Subject: How do I copy a user password from one server to another using
> tools provided in OpenLDAP Software
>
> Does OpenLDAP Software include a tool for copying a user password from one
> server to another?