Results 1 to 3 of 3

Thread: [SOLVED] Move passwords from /etc/shadow to zimbra

  1. #1
    evertonxvieira is offline Active Member
    Join Date
    Aug 2008
    Posts
    25
    Rep Power
    6

    Default [SOLVED] Move passwords from /etc/shadow to zimbra

    Hello,

    I'm trying to use this script from the wiki to get the shadow's password and put it into zimbra ldap, but it's not working.

    Script from wiki:
    #!/usr/bin/perl
    # Usage: as root # ./shadow2zm.pl /etc/shadow > shadow.zm
    # as zimbra # zmprov < shadow.zm

    $domain="my.domain.com";

    while(<>) {
    chomp;
    my ($uname,$pass) = split(/:/);

    print qq{zmprov ma $uname\@$domain userPassword '{crypt}$pass'\n};
    print qq{\n};
    }


    The first command runs withou problems ( ./shadow2zm.pl /etc/shadow > shadow.zm)

    But when I try to execute the second command with zimbra user(zmprov < shadow.zm) its prompt to me several messages like this:

    prov> Unknown command. Type: 'help commands' for a list
    prov> Unknown command. Type: 'help commands' for a list
    prov> Unknown command. Type: 'help commands' for a list
    prov> Unknown command. Type: 'help commands' for a list

    And the password from the file shadow.zm was not apllyed.

    Can anyone give me a hint?

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Just run it as
    Code:
    su - zimbra
    sh ./shadow.zm
    The reason why is that zmprov is being called for each line anyway.

  3. #3
    evertonxvieira is offline Active Member
    Join Date
    Aug 2008
    Posts
    25
    Rep Power
    6

    Default

    Thanks a Lot uxbod!!!

    It Worked...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 01-12-2012, 02:20 AM
  2. [SOLVED] parts_decode_ext error
    By jsabater in forum Administrators
    Replies: 7
    Last Post: 10-13-2008, 07:24 AM
  3. [SOLVED] Clamav problem ? What's happening ?
    By aNt1X in forum Installation
    Replies: 23
    Last Post: 02-14-2008, 05:43 AM
  4. Replies: 31
    Last Post: 12-15-2007, 09:05 PM
  5. zmtlsctl give LDAP error
    By sourcehound in forum Administrators
    Replies: 5
    Last Post: 03-11-2007, 03:48 PM

Posting Permissions

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