GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NSS_NDB(8) nss_ndb 1.0.24 man page NSS_NDB(8)

nss_ndb - BerkeleyDB nsswitch backend for passwd and group data

The 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.

First 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

The 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:

passwd.byname
Key: user-name
Data: user:password:uid:gid:class:change:expire:gecos:home:shell
passwd.byuid
Key: uid
Data: user:password:uid:gid:class:change:expire:gecos:home:shell
group.byname
Key: group-name
Data: group:password:gid:user,user,user,...
group.bygid
Key: gid
Data: group:password:gid:user,user,user,...
group.byuser
Key: user
Data: user:gid,gid,gid,...

passwd.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^@

/usr/local/share/examples/nss_ndb/ndbsync
/var/db/nss_ndb

makendb(8), nsstest(8), nss_ndb.conf(5), nsswitch.conf(5), nsdispatch(3), https://github.com/ptrrkssn/nss_ndb

nss_ndb and tools was written by Peter Eriksson <pen@lysator.liu.se>.
12 Jun 2020 1.0.24

Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.