From owner-freebsd-questions Wed May 13 18:10:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA02270 for freebsd-questions-outgoing; Wed, 13 May 1998 18:10:45 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from nwalme.pair.com (nwalme.pair.com [209.68.1.123]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA02236 for ; Wed, 13 May 1998 18:10:29 -0700 (PDT) (envelope-from dima@nwalme.pair.com) Received: (from dima@localhost) by nwalme.pair.com (8.8.8/8.6.12) id VAA22579; Wed, 13 May 1998 21:10:29 -0400 (EDT) Message-Id: <199805140110.VAA22579@nwalme.pair.com> X-Envelope-To: freebsd-questions@freebsd.org Subject: Re: renaming of usernames and homedirectories To: djv@bedford.net Date: Wed, 13 May 1998 21:10:29 -0400 (EDT) Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: <199805132200.SAA07148@castor.loco.net> from CyberPeasant at "May 13, 98 06:00:36 pm" From: Dima Dorfman X-Mailer: ELM [version 2.4ME+ PL22 (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. I have never used any of this tool, vipw. I always just edit /etc/master.passwd and do a pwd_mkdb. This eams to work just fine. Also, the only real reason I might use chfn is if I don't have root access. Is there a reason why I shouldn't edit /etc/master.passwd? > > 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 > -- Dima Dorfman (dima@zwb.net) "640k ought to be enough for anybody." - Bill Gates, 1981 Micro$oft Sucks! FreeBSD Rules! http://www.freebsd.org/ Finger dima@zwb.net for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message