From owner-freebsd-questions@FreeBSD.ORG Wed Dec 20 18:19:23 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1404B16A501 for ; Wed, 20 Dec 2006 18:19:23 +0000 (UTC) (envelope-from dnewman@networktest.com) Received: from ns.networktest.com (ns.networktest.com [207.181.8.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id B271F43C9F for ; Wed, 20 Dec 2006 18:19:19 +0000 (GMT) (envelope-from dnewman@networktest.com) Received: by ns.networktest.com (Postfix, from userid 1020) id E466E171C6; Wed, 20 Dec 2006 10:18:17 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on saronni.eng.networktest.com X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 Received: from [172.31.0.254] (dhcp254.eng.networktest.com [172.31.0.254]) by ns.networktest.com (Postfix) with ESMTP id 65660171C3 for ; Wed, 20 Dec 2006 10:18:12 -0800 (PST) Message-ID: <45897EA1.1010800@networktest.com> Date: Wed, 20 Dec 2006 10:19:13 -0800 From: David Newman User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <458964AB.2080400@edpausa.com> <200612201106.03880.kirk@strauser.com> In-Reply-To: <200612201106.03880.kirk@strauser.com> X-Enigmail-Version: 0.94.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: replicating /etc/passwd on a failover machine X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2006 18:19:23 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/20/06 9:06 AM, Kirk Strauser wrote: > On Wednesday 20 December 2006 10:28 am, stas khromoy wrote: > >> i doubt that just copying over /etc/passwd and master.passwd will work . > > You'd also need to pick up /etc/{s,}pwd.db - the compiled versions of those > files. Dunno if this works on FreeBSD, but with OpenBSD I have successfully copied accounts between machines like this: 1. Run vipw on both machines and copy and paste the user accounts. vipw works like vi. Note that this step assumes the same environment exists on the source and destination machines. If, for example, a user's shell is bash on the source machine, then /usr/local/bin/bash must exist on the destination box as well. 2. Copy and paste the relevant user groups from /etc/group. If users are members of other groups (e.g., wheel), ensure that info matches as well. 3. On the source machine, run: rsync -avz /home// destination_machine:/home This will move username's home directory over, preserving ownership and permissions for all directories and files. Note the trailing slash on the source directory. This probably needs to be run as root, which means that at least temporarily you need to go into the destination machine's /etc/ssh/sshd_config and add this line: PermitRootLogin yes and then restart sshd like this: kill -HUP `cat /var/run/sshd.pid` If you don't normally want ssh access for root, be sure to undo that change in sshd_config once you're done. dn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFFiX6hyPxGVjntI4IRAs6PAKCk1YP2cKYWx70NxU5ZiOQyFtgHLACffFIH 27pgxgkQ+CYOaBJWD3n/2MQ= =nMBm -----END PGP SIGNATURE-----