YP_MKDB(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸŽ€ yp_mkdb β€” generate the NIS databases ✨

okay so bestie, you've landed on yp_mkdb(8) from the System Manager's Manual (section 8, we love a numbered section πŸ’…). This is the little utility that builds your NIS databases, and honestly? It eats. Let's get into it. 🫢


🌈 SYNOPSIS 🌈

yp_mkdb -c
yp_mkdb -u dbname
yp_mkdb [-c] [-b] [-s] [-f] [-i inputfile] [-o outputfile]
        [-d domainname] [-m mastername] inputfile dbname

three whole modes, no cap. pick your fighter. ✨


πŸ’– DESCRIPTION πŸ’–

So. The yp_mkdb utility creates db(3) style databases for use with FreeBSD's NIS server. iconic behavior. πŸ‘‘

It reads data from inputfile, and writes it to dbname in db(3) format (using the hash table method β€” hash table girlies rise 🌸). The input should be in 'key data' format, which is to say two fields of ASCII data separated by white space. The first field is assumed to be the key, and everything else is assumed to be the data. simple as that, fr fr.

These databases are typically stored in /var/yp/[domainname] where domainname is the name of the NIS domain being served. The yp_mkdb utility is usually invoked by /var/yp/Makefile. and it's not only a builder: yp_mkdb can also be used to dump an NIS database file so that its contents can be examined. inspector mode activated πŸ”βœ¨

πŸ’€ security moment, listen up: for security reasons, all databases that yp_mkdb creates are readable and writable by owner only (and usually the owner is root). so, like, don't expect to just vibe your way in there.

The following options are available:


✨ OPTIONS ✨

  • -c β€” cause yp_mkdb to send a YPPROC_CLEAR request to ypserv(8) on the local host. This signal tells the server to close any open database descriptors and flush out its database cache. 🫧 If used alone, this flag signals the server and does nothing else. If used as part of a database creation command, yp_mkdb will send the signal only after the new database has been successfully created. (patience is a virtue, bestie πŸ’…)
  • -b β€” cause yp_mkdb to add a special entry to the database with a key of YP_INTERDOMAIN and an empty data field. If this key is present in a map, it alters the behavior of the 'match' procedure in ypserv(8) slightly. If a match query fails (because the server could not find a record that matched the supplied key), and the YP_INTERDOMAIN key exists within the queried map, ypserv(8) will try to match the entry again using a DNS lookup. πŸ¦‹ Note that this special behavior only applies to the hosts maps. Using the -b flag for other maps has no effect. (sorry not sorry πŸ™ˆ)
  • -s β€” this flag is used to add a special entry to the database with a key of YP_SECURE and an empty data field. If this key is present in a map, ypserv(8) will deny access to the map to any client that is not using a reserved port for its query. πŸšͺ✨ This is used mainly for the master.passwd maps, which should be restricted to privileged access only. gatekeeping, but make it sysadmin.
  • -f β€” this flag is used to turn on filtering of lines in the source file input that start with + or - characters. These characters have special meaning for the group, passwd and master.passwd maps and hence should not be allowed to appear in them as the first character of a key or datum. If the -f flag is used, yp_mkdb will reject any source line that starts with a + or - character and issue a warning message displaying the line that was dropped. 😭 rude but fair. blocked and reported.
  • -u dbname β€” dump (or 'unwind') an NIS database. This option can be used to inspect the contents of an existing NIS database. πŸ‘€ the way this is just a little peek behind the curtain.
  • -i inputfile β€” when generating an NIS map, encode inputfile as a special entry in the database with a key of YP_INPUT_FILE. πŸ“
  • -o outputfile β€” when generating an NIS map, encode outputfile as a special entry in the database with a key of YP_OUTPUT_FILE. πŸ“
  • -d domainname β€” when generating an NIS map, encode domainname as a special entry in the database with a key of YP_DOMAIN_NAME. 🌈
  • -m mastername β€” when generating an NIS map, encode mastername as a special entry in the database with a key of YP_MASTER_NAME. This entry in the database is frequently used by various NIS utilities to determine the name of an NIS master server for a domain. By default, yp_mkdb assumes that the local host is the NIS master; the -m option is used to override this default. main character energy: the local host assumed it was the master. and honestly? valid. πŸ‘‘

πŸ¦‹ FILES πŸ¦‹

  • /var/yp/Makefile β€” the Makefile that calls yp_mkdb to build the NIS databases πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ’œ


🌸 AUTHORS 🌸

Bill Paul <wpaul@ctr.columbia.edu> β€” thank you for your service, legend 🫢


okay that's the whole page bestie, you're basically an NIS master now πŸ‘‘βœ¨ this lil Debian edition dropped on March 12, 1996 (a vintage icon, we stan a classic πŸ’–), so go forth, build those databases, and remember: readable and writable by owner only. slay. πŸ’…πŸŽ€

πŸ“¦ where this page comes from