Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 1998 18:00:36 -0400 (EDT)
From:      CyberPeasant <djv@bedford.net>
To:        heinrich@zaphod.wh9.tu-dresden.de (Heinrich Langos)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: renaming of usernames and homedirectories
Message-ID:  <199805132200.SAA07148@castor.loco.net>
In-Reply-To: <199805131953.VAA16206@zaphod.wh9.tu-dresden.de> from Heinrich Langos at "May 13, 98 09:53:13 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.

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



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