Hidden NIS/NIS+ database used for jails?

dmayle

Cadet
Joined
Mar 15, 2023
Messages
3
I am trying (and can't for the life of me) understand how the user/group database is setup in iocage jails.

In each individual jail, the /etc/nsswitch.conf file says `passwd: compat`and `passwd_compat: nis`.

Calling `getent passwd` gives you the password database, but it doesn't reflect any changes you make to /etc/passwd

There are no files in /var/yp (other than Makefile) or /var/nis

Even if you set the host_domainname in the jail properties to the same value, each jail has a different nis user database.

Where does this user database exist?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
BSD uses a Berkeley database for getpwent() funktions even in the absence of NIS. Standard well documented behaviour.

You cannot just edit /etc/passwd. You must use the vipw command to edit /etc/master.passwd. After saving and quitting the database files /etc/pwd.db and /etc/spwd.db are automatically built from that file as well as the passwordless /etc/passwd.

 
Last edited:
Top