Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 1998 21:10:29 -0400 (EDT)
From:      Dima Dorfman <dima@zwb.net>
To:        djv@bedford.net
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: renaming of usernames and homedirectories
Message-ID:  <199805140110.VAA22579@nwalme.pair.com>
In-Reply-To: <199805132200.SAA07148@castor.loco.net> from CyberPeasant at "May 13, 98 06:00:36 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805140110.VAA22579>