From owner-freebsd-questions@FreeBSD.ORG Sat Jul 7 17:23:27 2007 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 EDAAA16A484 for ; Sat, 7 Jul 2007 17:23:27 +0000 (UTC) (envelope-from mrspock@esfm.ipn.mx) Received: from mail.esfm.ipn.mx (esfm.ipn.mx [148.204.102.61]) by mx1.freebsd.org (Postfix) with ESMTP id C74E913C465 for ; Sat, 7 Jul 2007 17:23:27 +0000 (UTC) (envelope-from mrspock@esfm.ipn.mx) Received: from localhost (localhost.esfm.ipn.mx [127.0.0.1]) by mail.esfm.ipn.mx (Postfix) with ESMTP id 17D9A452D8; Sat, 7 Jul 2007 12:15:43 -0500 (CDT) X-Virus-Scanned: amavisd-new at esfm.ipn.mx Received: from mail.esfm.ipn.mx ([127.0.0.1]) by localhost (mail.esfm.ipn.mx [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KbgpqkBpWz2T; Sat, 7 Jul 2007 12:15:40 -0500 (CDT) Received: by mail.esfm.ipn.mx (Postfix, from userid 1000) id 50099452F8; Sat, 7 Jul 2007 12:15:40 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.esfm.ipn.mx (Postfix) with ESMTP id 4E85B452F5; Sat, 7 Jul 2007 12:15:40 -0500 (CDT) Date: Sat, 7 Jul 2007 12:15:40 -0500 (CDT) From: Eduardo Viruena Silva To: Lisa Casey In-Reply-To: <003701c7c0ac$f7a6f350$d5b9bfcf@lisac> Message-ID: <20070707114332.O40553@Gina.esfm.ipn.mx> References: <003701c7c0ac$f7a6f350$d5b9bfcf@lisac> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: passwd file and user accounts 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: Sat, 07 Jul 2007 17:23:28 -0000 On Sat, 7 Jul 2007, Lisa Casey wrote: > Hi, > > This is probably a stupid question, but I'll ask it anyway... > > I have a Red Hat Linux system I need to get rid of. It is currently doing > e-mail for approximately 700 users and is also doing radius authentication. I > have setup a new FreeBSD computer to take it's place. I have everything setup > now on the FreeBSD computer except for the user accounts and mailboxes. The > mailboxes aren't a problem, I've used tar to move mailboxes before. > > I suppose I cannot simply copy /etc/passwd, /etc/group and /home from the > Redhat computer to the FreeBSD computer due to the password hash in > /etc/passwd. Am I correct on this? Would it be possible to copy /etc/passwd > then (before the new system goes "live") reset all the passwords with the > passwd command? That might be easier than adding in close to 700 accounts > using adduser. Does anyone have a better idea of how I might go about doing > this? Yes, you are right, you cannot simply copy the password files. FreeBSD and RedHat passwords files have different formats, and they also have different User IDs for the system users. Your real problem is to merge RedHat's "/etc/passwd" and "/etc/shadow" in order to create your /etc/master.passwd in FreeBSD and then you have to create your hash db from this file. In RedHat for instance, you have: /etc/passwd: daemon:x:2:2:daemon:/sbin:/sbin/nologin /etc/shadow: daemon:*:11688:0:99999:7::: Meaning: /etc/passwd: UserName:x:UserID:GroupID:RealName:HomeDir:Shell /etc/shadow: UserName:CryptedPassword:... In FreeBSD's master.passwd, you have: daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin UserName:CryptedPassword:UserId:GroupId:UserName:LogClass:0:0:RealName:HomeDir:Shell As you can see, "daemon" has different UIDs. I believe RedHat also uses MD5 for coding passwords but I do not know it for sure. So, take ONLY the entries of YOUR USERS and merge them in the FreeBSD's format and leave the list in a file. Once you have done this, use 'vipw' to edit your master.passwd, include your file of your users, and save it. This program will create your hash table and will update the password files. Good luck. Eduardo > > Thanks, > > Lisa Casey >