Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-2009, 07:44 AM
Active Member
 
Posts: 25
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?
Reply With Quote
  #2 (permalink)  
Old 02-06-2009, 07:49 AM
Moderator
 
Posts: 7,928
Default

Just run it as
Code:
su - zimbra
sh ./shadow.zm
The reason why is that zmprov is being called for each line anyway.
__________________
Reply With Quote
  #3 (permalink)  
Old 02-06-2009, 08:53 AM
Active Member
 
Posts: 25
Default

Thanks a Lot uxbod!!!

It Worked...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.