Page 1 of 1
Backup user's password?
Posted: Tue Sep 25, 2007 12:33 pm
by Beaujolais
Is there a way how to backup and restore user's password?
Occasionally when user's mailbox is corrupted beyond repair I have to delete the user and then re-create it.
But prior I'd like to export user's password (in hashed form is fine) and then restore it later.
Is there a way to do it?
Posted: Wed Sep 26, 2007 6:32 am
by gren
The encrypted password is stored in the USERLIST directory. Be aware that it can contain strange characters, so you may need to exercise care in changing things.
To find the value of the current password for, say, 'S=gren/OU1=crowley/CN=gren' :
Do :
Code: Select all
omsearch -s -t h -d USERLIST -m UL-PWD -e 'S=gren/OU1=crowley/CN=gren'For me, this output :
Code: Select all
UL-PWD=$1$vb9UFNoR$GZLuclJgG2UqtdSjI\/VT5\/I then deleted the user and re-added it. The following command restored the password:
Code: Select all
ommodent -t h -d USERLIST -n 'UL-PWD=$1$vb9UFNoR$GZLuclJgG2UqtdSjI\/VT5\/' -e 'S=gren/OU1=crowley/CN=gren'
Regards,
Gren.
Posted: Mon Oct 01, 2007 6:19 pm
by Beaujolais
thanks
Posted: Fri Nov 02, 2007 7:07 pm
by GodOfTheWired
I tried updating an account with an exported password, no such luck.
It seems that ommodent doesn't like $ signs:
[root@webmail ~]# ommodent -t h -d USERLIST -n 'UL-PWD=$1$8fi0glRB$fjj4J12iywoW0mOUecyrY1' -e 'UL-AUTHID=xxxx'
UL-AUTHID=xxxx
[OM 16078] An attribute's value contains invalid characters.
Parameter : Directory Entry Modifier
Attribute : UL-PWD
Max allowed size : 36
Required syntax : IA5-STRING
Value in error : \ufffd1\ufffd8fi0glRB\ufffdfjj4J12iywoW0mOUecyrY1
Any ideas? Is there a way to escape or convert the $ signs so that ommodent takes them?