Results 1 to 3 of 3

Thread: Save, modify and restore User Password

  1. #1
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    2

    Default Save, modify and restore User Password

    I import a lot of .pst files and I don't want to change the user password.

    What I have tried:
    1. save the password (encrypted)
    /opt/zimbra/openldap/bin/ldapsearch -LLL -x -D"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_userdn| awk '{print $3}'`" -w"`/opt/zimbra/bin/zmlocalconfig -s zimbra_ldap_password|awk '{print $3}'`" -H `/opt/zimbra/bin/zmlocalconfig ldap_url|awk '{print $3}'` "(uid=test)"
    ...
    userPassword:: e1NTSEF9bjkxTFhsbGczUjc2MDJHYTQ5cVVOYUo1WU4xMEtSNj E=
    ...

    2. Change the password

    zmprov ma test@test.ch userPassword '123456'

    3. Import the .pst files

    4. Restore the base password

    zmprov ma test@test.ch userPassword '{crypt}e1NTSEF9bjkxTFhsbGczUjc2MDJHYTQ5cVVOYUo1WU 4xMEtSNjE='

    And only this last command doesn't work, the password is changed.
    Is this possible to restore the base password for this user ?

    Any help would be appreciated ;-)

    Blaise

  2. #2
    Join Date
    Jul 2007
    Location
    US
    Posts
    67
    Rep Power
    8

    Default

    Hi Blaise,

    The password you pulled via LDAP is Base64 encoded. Here's one way you can decode it:
    Code:
    $ perl -MMIME::Base64 -le 'print decode_base64(shift)' e1NTSEF9bjkxTFhsbGczUjc2MDJHYTQ5cVVOYUo1WU4xMEtSNjE=
    {SSHA}n91LXllg3R7602Ga49qUNaJ5YN10KR61
    If you restore the value to userPassword with that value things should work as expected.

  3. #3
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    2

    Default

    Great ;-)
    That's working fine. Thank you.

Similar Threads

  1. Password save problem
    By GlooM in forum Administrators
    Replies: 12
    Last Post: 09-01-2013, 03:38 AM
  2. Replies: 1
    Last Post: 07-08-2011, 07:40 AM
  3. modify existing user to have Samba attributes
    By ebourkland in forum Administrators
    Replies: 5
    Last Post: 02-23-2010, 11:20 AM
  4. Password Save
    By MyLive in forum General Questions
    Replies: 0
    Last Post: 08-07-2009, 10:00 AM
  5. Can't modify user accounts
    By jandrews in forum Administrators
    Replies: 6
    Last Post: 05-16-2008, 09:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •