Solved [Solved]: pw useradd not working right

I've tried for hours to change the password for a wheel, operator user in a new install.

Persistent errors (sysinstall also fails) such as:
Code:
# pw useradd toor9
toor9 already exists
# chpass toor9
unknown user toor9

With the five or so pw and related commands, guides, manpages, etc., rather terse and persistent errors continually occur even with known-working files replacing most of the passwd (etc) files in /etc. I've read and re-read and re-tried most every command commonly mentioned, but as seen above, never with a real result. Perhaps part of a installkernel; installworld to a /mnt missed an additional step, not copying some file? Or some specific editing could create-from-scratch all of the wheel group logins and passwords, without removing those in use by other programs.


Edit: It turns out the install skipped installing files in /etc/periodic and /etc/defaults. I'm testing whether completing those two fixes this issue here.
 
Re: [PBKAC]: pw useradd not working right

The password I had tried to set for hours, suddenly works upon simply copying from a working machine the following empty directories: /etc/pam.d, /etc/mtree, /etc/gnats, /etc/gss, /etc/ntp, /etc/security and /etc/ssl. FWIW the other thing I learned during this install, is at least with the legacy pkg_add one can pkg_add -i -v -f ...tbz and it will install despite not installing dependencies, and one can pick and choose which ones to subsequently install - icu after harfbuzz, for example. I mysteriously obtained a working desktop that way, although with a lot of make -k install in (for example) several metaports -- which installed ninety percent of them in a working state, and the remainder of which were easily fixed by installing one-by-one.
 
I've seen that during happen during upgrades if the user didn't perform the mergemaster -p step to add a user beforehand but that doesn't seem right during an installation. The issue was that while the user may have existed /etc/passwd and/or /etc/master.passwd, they didn't get updated in the system database files /etc/pwd.db and /etc/spwd.db. Doing vipw and immediately saving and exiting with :wq would force an update. The pwd_mkdb() command can also be used to update the database files. According to the pkg_add() man page, the -f flag will force an install even if prerequisites fail, explaining what you observed.

Did you manage to get everything working yet? It seems you took some very odd steps doing a fresh install via make installkernel; make installworld and your mix if legacy packages and ports. Is there reason you didn't use the new pkg repositories? If you have some messed up package dependencies pkg upgrade -fy could force an upgrade and reinstallation of all packages after you get mapped to the public repositories and should fix some of the dependency issues you may have.
 
I got it all working, but it crashes upon the mounting of a 2nd second USB device (I neglected to mention that the install was to a thumbdrive). I've given up on that; hopefully it will be more resilient with a plugged in USB thumbdrive if the boot drive isn't a thumbdrive; I expect to test it within the next week or so. As far as pkg goes, no time for that until something deems it expedient (aside from the fact that the port won't build here, months on end).
 
Back
Top