Regenerating the password databases on new installs

Aaron LI aly at aaronly.me
Tue Feb 7 21:52:59 PST 2023


Hi,

I've looked at the installation doc and the code, and I can confirm this issue.

It's caused by the inconsistency between the DBs (pwd.db and spwd.db) and the passwd files (i.e., master.passwd, passwd, group).  On the release ISO/IMG, there are '/etc' and '/etc.hdd' (the latter is copied to the installing machine).  During the release building, the 'installer' user was added to '/etc', but only the passwd files were copied to '/etc.hdd', and thus the aformentioned inconsistency.  And this inconsistency caused the adduser (pw adduser) issue here.

And as you figured out, a rebuild of the DBs (pwd_mkdb) resolved the issue.

So, I've updated the installation doc to add the missing pwd_mkdb step, which is actually performed by the installer.

On the other hand, I'll try to improve the release build Makefile to eliminate the inconsistency as well.

See also: https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/nrelease/Makefile
(lines 237-241, 328-331)

Cheers,
Aaron

> On Feb 8, 2023, at 06:53, Mayu Inc. <pomomayu at gmail.com> wrote:
> 
> 
> We successfully installed new systems on a few different machines using the extended layout guide in the handbook to utilize pseudo filesystems. On every install we've had to re-generate the password databases or else new users are  visible in /etc/passwd but unable to login.
> 
> The following error occured after creating a new user with the 'adduser' utility:
> 
> pw: user 'myuser' disappeared during update.
> adduser: ERROR: There was an error adding user (myuser).
> 
> Using this work-around before creating any users seems to work:
> 
>       # cp /etc/passwd /etc/passwd.orig
>       # cp /etc/master.passwd /etc/master.passwd.orig
>       # pwd_mkdb /etc/master.passwd



More information about the Users mailing list