From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 14 08:20:14 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8671316A41F for ; Fri, 14 Oct 2005 08:20:14 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3234D43D45 for ; Fri, 14 Oct 2005 08:20:14 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 4412B46B3B; Fri, 14 Oct 2005 04:20:12 -0400 (EDT) Date: Fri, 14 Oct 2005 09:20:12 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: iwan@staff.usd.ac.id In-Reply-To: <38664.202.65.114.154.1129284462.squirrel@webmail.usd.ac.id> Message-ID: <20051014091520.R66245@fledge.watson.org> References: <38664.202.65.114.154.1129284462.squirrel@webmail.usd.ac.id> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: system password's file X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2005 08:20:14 -0000 On Fri, 14 Oct 2005 iwan@staff.usd.ac.id wrote: > I want to migrate from linux to freebsd. My linux box (mail server) have > alot of user (hundreds) --this is the problem. I dont know which file > which the password's file. I dont want typing user name and its password > one by one. Beside of that, thereis possibly my users change their > passwords. How can I do this migrating ? (save) I'm sorry my English is > not good. The main man page you want to look at is passwd(5), which documents the formats of the /etc/master.passwd and /etc/passwd file. In FreeBSD, the master.passwd file is the equivilent of the shadow file in Linux. What you want to do is convert the Linux password files to the master.passwd file in FreeBSD, and then run pwd_mkdb -p /etc/master.passwd This will cause /etc/passwd to be built from /etc/master.passwd, and also cause the rebuilding of two hash files that cache the user data in a machine-readable format to improve performance, /etc/pwd.db (cache of passwd) and /etc/spwd.db (cache of master.passwd). You can use the -C argument to simply test if a file has the correct format and run sanity checking, which is useful if you want to test a conversion without possibly installing the results. Take a look at the pwd_mkdb(8) man page for details. Robert N M Watson