Solved /root and /etc/passwd reverted default?

Hi, I was trying to update the version of bsdinstall to 13.0 and after bsdinstall fetch && bsdinstall extract I was no longer able to login, then after reboot I found my user no longer exists in /etc/passwd and some changes I did in /root/.cshrc are no more there.

I still have my zfs datasets (zroot and datos) intact, also automatic snapshots like:

zroot@zfs-auto-snap_daily-2021-06-21-00h07

and

zroot/ROOT/default@zfs-auto-snap_daily-2021-06-21-00h07

If I revert to those snapshots, will I recover those files?.
 
Maybe the first question which concrete action did you undertake to overwrite the password database.
Mergemaster informs and etcupdate is smart. Did you blindly extract a tarball ? If so and you have a snapshot you can try.
But don't let the snapshot lose you more data.
Just mount the snapshot and check the password database.
 
What I did was this:

Code:
export BSDINSTALL_DISTDIR=/usr/freebsd-dist
bsdinstall distfetch

export DISTRIBUTIONS="base.txz kernel.txz"
export BSDINSTALL_CHROOT=/
bsdinstall distextract

Now, could that have overwritten the /etc/passwd file?
 
Yes, the /etc/passwd file in the snapshot contains the user (and other users) needed.

How can I revert to it?
 
Try to mount a snapshot and have a look at "/etc/master.password".
From the good snapshot you can copy this file to /etc
And then you run,
Code:
/usr/sbin/pwd_mkdb -p /etc/master.passwd
Normally that should fix it.
[I use absolute paths here and not relative]
 
Great!, now I can login as the normal user, now I have to copy the /etc/group also (for sudoers).

Rebooting....
 
Back
Top