|
NAMEnss_ndb - BerkeleyDB nsswitch backend for passwd and group dataDESCRIPTIONThe nss_ndb nsswitch backend is a shared library that enables usage of BerkeleyDB btree database files as a backend for passwd and group data. It is tuned to be fast and efficient for large installations (>100,000 entries in passwd & group databases) and handle users being member of many groups efficiently.CONFIGURATIONFirst make sure there is a symbolic link from /usr/lib/nss_ndb.so.1 to the real location of the nss_ndb.so.<version> library.Second step is to populate the databases in the /var/db/nss_ndb/ directory. Third step is to activate the use of nss_ndb in the /etc/nsswitch.conf file by adding the ndb keyword on the passwd and group lines Depending on how nss_ndb was built support for a configuration file and/or a configuration environment variable (by default NSS_NDB_CONFIG) may (but normally isn't) have been enabled. The environment variable is probably mostly useful for debugging purposes and uses the same options as the configuration file but are specified as a comma-separated list of key:val pairs. For details of the configuration file see: nss_ndb.conf(5) You can check if nss_ndb was built with support for a configuration file and/or variable by: $ strings /usr/lib/nss_ndb.so.1 | fgrep nss_ndb.conf $ strings /usr/lib/nss_ndb.so.1 | fgrep NSS_NDB_CONFIG DATABASEThe databases are normally stored in /var/db/nss_ndb and can be populated via the makendb tool from text files.A more efficient way is to use a sync tool to update the local NDB databases from a remote source regularily (like a MySQL server, or an AD or LDAP server). An example sync tool talking to a MySQL server written in Perl is available as ndbsync(8) which can be modified for your purposes. If you write your own - make sure you do not forget to lock (using flock (2)) the databases before updating them in order to maintain consistency. All tables use UTF-8. All values include a terminating NUL character and have the following format:
EXAMPLESpasswd.byname: Key: anna Data: anna:*:1000036:1000000::0:0:Anna Andersson:/home/anna:/bin/sh^@ passwd.byuid Key: 1000036 Data: anna:*:1000036:1000000::0:0:Anna Andersson:/home/anna:/bin/sh^@ group.byname Key: wheel Data: wheel:*:0:root,peter,mike,john,anna^@ group.bygid Key: 0 Data: wheel:*:0:root,peter,mike,john,anna^@ group.byuser Key: anna Data: anna:1000000,0,101,102^@ FILES
SEE ALSOmakendb(8), nsstest(8), nss_ndb.conf(5), nsswitch.conf(5), nsdispatch(3), https://github.com/ptrrkssn/nss_ndbAUTHORnss_ndb and tools was written by Peter Eriksson <pen@lysator.liu.se>.
Visit the GSP FreeBSD Man Page Interface. |