From owner-freebsd-questions Thu Apr 11 2:51:43 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dns.perimeter.co.za (dns.perimeter.co.za [196.25.164.254]) by hub.freebsd.org (Postfix) with ESMTP id E9EF237B431 for ; Thu, 11 Apr 2002 02:51:20 -0700 (PDT) Received: from PATRICK (loopback.mipjhb [209.212.102.245] (may be forged)) by dns.perimeter.co.za (8.11.1/8.11.1) with SMTP id g3B9pDL33905; Thu, 11 Apr 2002 11:51:13 +0200 (SAST) (envelope-from bsd@perimeter.co.za) Message-ID: <017401c1e13e$27b94600$b50d030a@PATRICK> From: "Patrick O'Reilly" To: "Erik Funkenbusch" , References: <00ab01c1e104$dd8fc470$838ecd40@hedgehog> Subject: Re: Moving user information Date: Thu, 11 Apr 2002 11:49:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ----- Original Message ----- From: "Erik Funkenbusch" > Can anyone outline the steps I should take to move all users and user data > to another server? > > I don't want to recreate the users, so i'm looking for someway to export the > user data and login information to another server. What files are necessary > to copy, and is it possible to merge two password databases? Off the top of my head: 1) Have someone else double-check and confirm that I have not said something very stupid here! 2) Make sure you do not have duplicated user names OR user IDs on the two servers. The duplication of system accounts, like root, named, smmsp, etc will be handled in step 4. 3) If all user files are in the users' home directory trees, then tar it all up and untar it on the new server. # cd /home # tar czf /tmp/home.tgz . Now move the /tmp/home.tgz file to the new server, and on that new server do: # cd /home # tar xzf /tmp/home.tgz 4) copy the two /etc/master.passwd files from the two servers to the new server as /tmp/master.old and /tmp/master.new. Now, on the new server: # cd /tmp # cat master.old master.new > master.passwd # sort -o master.passwd master.passwd # vi master.passwd ( check for duplicated names and remove them - BE CAREFULL not to damage field 2 - that's the encrypted password) # sort -n -t: +2 -3 -o master.passwd master.passwd # vi master.passwd ( check for duplicated user ids [column 3] and remove them - BE CAREFULL not to damage field 2 - that's the encrypted password. Also, find the "root" account and make sure it is the first account listed, and move the line "# $FreeBSD: src/etc/master.passwd..." to the very top of the file [remove the older version's comment line]) 5) make a backup copy of /etc/master.passwd # cp /etc/master.passwd /etc/master.passwd.backup 6) Install the new Password Database: # pwd_mkdb /tmp/master.passwd ( this will install the master.passwd file to /etc, and rebuild the databases ) 7) Test a user login while holding thumbs very firmly ( I'd love to see how you type while holding thumbs :) 8) If there is a problem you can restore your backup like so: # pwd_mkdb /etc/master.passwd.backup As I said in (1), please verify this with someone else as I've thrown these instructions together rather quickly. Regards, Patrick O'Reilly. ___ _ __ / _ )__ __ (_)_ __ ___ _/ /____ __ / __/ -_) _) / ~ ) -_), ,-/ -_) _) /_/ \__/_//_/_/~/_/\__/ \__/\__/_/ http://www.perimeter.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message