Cannot Add User

Vince Sabio vince at vjs.org
Wed Feb 4 10:05:06 PST 2004


** Sometime around 09:21 -0500 02/04/2004, Lowell Gilbert sent everyone:
>Vince Sabio <vince at vjs.org> writes:
>
>[...]
>  > I'm now trying to install Postfix, and the problem I'm running into is
>>  that I cannot create new user accounts. I created several user
>>  accounts during installation, and they seem to be fine. But when I
>>  [manually] create entries in /etc/passwd, master.passwd, and group,
>>  the entries are 'ignored' -- e.g., a "chown [newuser] [filename]"
>>  command fails, attempts to su from root into the user account fail,
>>  etc. When I try to create the user via adduser (using the standard
>>  defaults), the account creation step fails with the following error:
>>
>  > pw: user '[newuser]' disappeared during update
>
>It sounds like you've messed up your user database.  Try running
>pwd_mkdb(8) by hand to get it straightened out.  In future, remember
>not to edit passwd and so forth by hand; stick with adduser(8) and/or
>vipw(8) to avoid shooting yourself in the foot like this.

I have to wonder if this is unique to the BSDs; I've been using 
Solaris for nearly a decade now, and the _only_ way I've ever created 
user accounts is manually -- by editing /etc/passwd, shadow, and 
group files, creating user directories, etc. I've never had a problem 
with it before. (I'm pretty sure I've done the same under Linux, 
too.) Running adduser is fine for simple user accounts -- but there 
are few user accounts on a typical server. The problem with adduser 
is that it isn't well suited to things like accounts with no home 
directories or login shells, disabled passwords (not the same as a 
locked account), etc.

Either way, I tried running pwd_mkdb -C /etc/passwd, and it reported 
a format error on line 3 -- which happens to be the root account, and 
is the first real data line in the file. Moreover, it's a line that I 
didn't modify. It reported no errors on /etc/master.passwd, so I 
copied and modified it into a passwd file -- and pwd_mkdb then 
reported no errors on the new passwd file. However, that action also 
prevented any new logins, and running passwd didn't fix the problem.

So, after mucking around with pwd_mkdb for a while, I opted to simply 
reinstall the OS -- it was still a rather new installation, and I 
wanted to increase the /usr partition, anyway. After completing the 
new FreeBSD installation, the first thing I did upon logging in was 
run pwd_mkdb on /etc/passwd, and it still reported a format error on 
line 3. I then manually added the necessary users, and this time the 
postfix installation ran to completion.

While it's possible that I messed up the format on the original try, 
it's unlikely -- I checked it over a dozen times before going in 
search of a FreeBSD list on which to ask the question. I'm thinking 
that there might have been something else in the mix. But either way, 
the clean install fixed it (though admittedly it was a rather 
Draconian fix).
-- 

__________________________________________________________________________
Vince Sabio                                                  vince at vjs.org


More information about the freebsd-questions mailing list