From owner-freebsd-questions Wed May 13 15:16:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA29559 for freebsd-questions-outgoing; Wed, 13 May 1998 15:16:34 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from castor.loco.net (lucy.bedford.net [206.99.145.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA29491 for ; Wed, 13 May 1998 15:16:17 -0700 (PDT) (envelope-from listread@bedford.net) Received: (from listread@localhost) by castor.loco.net (8.8.8/8.8.8) id SAA07148; Wed, 13 May 1998 18:00:36 -0400 (EDT) (envelope-from listread) Message-Id: <199805132200.SAA07148@castor.loco.net> Subject: Re: renaming of usernames and homedirectories In-Reply-To: <199805131953.VAA16206@zaphod.wh9.tu-dresden.de> from Heinrich Langos at "May 13, 98 09:53:13 pm" To: heinrich@zaphod.wh9.tu-dresden.de (Heinrich Langos) Date: Wed, 13 May 1998 18:00:36 -0400 (EDT) Cc: freebsd-questions@FreeBSD.ORG Reply-to: djv@bedford.net From: CyberPeasant X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Heinrich Langos wrote: > Hi > > first of all i have to admit that i'm a linux user so some of the concepts > of freebsd look a little strange to me. now i'm stuck with a system that i > have to maintain as long as the owner is ill. > > 1) > how do I rename a user in FreeBSD 2.2.5 on linux i just go and change his > name in /etc/passwd and maybe even in /etc/shadowpasswd and thats it. You have not been doing it correctly, then. Use vipw to alter passwd/shadow/ master.passwd on Linux /or/ Bsd. > but in Freebsd the name is also saved in that non-human-readable database > files. :-( > is there any use in that except for security by obscurity? (which history > has shown doesn't work anyway) and how do i get around it ? That would be your password database, the file that the authentication routines actually use. You can vi /etc/passwd, and -- surprise -- the changes don't seem to have effect. Use vipw. > 2) > > another problem is that i can't change a users home directory. if i change > it to something different and log in i'm sent to "/". changing the password > of that user overwrites my changes that i made to /etc/passwd and > /etc/master.passwd and replaces the home directory entry with the old one. Use vipw Use chpass Also, the dir has to exist. Sometimes it's easy to overlook creating the new home dir. If the homedir doesn't exist (or is not at least searchable by the user), I don't think you'll get cd'd there on login. Hence you get sent to /.) Actually, I'm willing to guess that chpass is (correctly) undoing the damage done to /etc/passwd by unsynchronized editing. Vipw, chpass, passwd, et al, run pwd_mkdb to synchronize the four files. Have a look at pwd_mkdb(8) on the BSD system. IIRC, there's something like it on Linux. (pwd_ck ? ckpwd? Memory fails... it's a utility to verify that passwd and shadow are synchronized). Hmm I thought that at least /some/ linuxes used a pwd.db spwd.db database, too. Never edit /etc/passwd or master.passwd or [linux] shadow directly. All bets are off if the BSD machine is running NIS. I don't know squat about NIS. Dave -- <----. mail-to: djv@bedford.net <----|=================================== <----' Zber Qnrzbaf, Srjre Qrivyf! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message