RPC.YPXFRD(8)

πŸ“¦
version 4.2 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– rpc.ypxfrd(8) β€” NIS map transfer server πŸ’–

okay bestie, sit down, we're talking about rpc.ypxfrd, straight out of section 8 of the NIS Reference Manual. she's a whole server, she moves maps, and she's lowkey the reason your NIS slave isn't sitting there buffering for six years. let's get into it πŸ¦‹


✨ SYNOPSIS ✨

/usr/sbin/rpc.ypxfrd [-d path] [-p port] [--debug]

/usr/sbin/rpc.ypxfrd --version

🌸 DESCRIPTION 🌸

so rpc.ypxfrd exists to make the transfer of very large NIS maps from a NIS master to a NIS slave server go fast. that's her whole job, that's her main character energy.

here's the situation without her: when a NIS slave server gets a message that there's a new map, it kicks off ypxfr to go get that new map. and ypxfr reads the contents of a map from the master server using the yp_all() function. one. entry. at. a. time. it's giving slow. it's giving why are we like this. 😭

rpc.ypxfrd swoops in and speeds up the whole transfer process by letting NIS slave servers simply copy the master server's map files instead of building their own from scratch. she does this with an RPC-based file transfer protocol. slay.

now the important caveat, and I need you to actually hear this one: if the on-disk format of the database on both machines is not the same, rpc.ypxfrd will refuse to send the data, and ypxfr will fallback to yp_all() and fetch every single entry alone. so she's not gonna hand you a file you can't read. she's dramatic but she's not messy. πŸ’…

also, rpc.ypxfrd could be started by inetd. but ngl β€” she starts very slowly, so she should be started after ypserv from /etc/init.d/ypxfrd. periodt.


πŸŽ€ OPTIONS πŸŽ€

  • --debug β€” makes the server run in debugging mode. in debug mode, she does not background herself, and she prints extra status messages to stderr for each request that she receives. it's her journaling era. 🫢
  • -d path β€” rpc.ypxfrd uses this directory instead of /var/yp.
  • -p port β€” rpc.ypxfrd will bind herself to this port, which makes it possible to have a router filter packets to the NIS ports. this can restrict the access to the NIS server from hosts on the Internet. gatekeeping, but make it network security. πŸ”₯
  • --version β€” prints the version number. that's it. that's the option. πŸ’–

πŸ”’ SECURITY πŸ”’

rpc.ypxfrd uses the same functions for checking a host as ypserv. so, step by step, here's how the vibe check goes:

  1. first, rpc.ypxfrd checks a request from an address against /var/yp/securenets or the tcp wrapper.
  2. if the host is allowed to connect to the server, rpc.ypxfrd then uses the rules from /etc/ypserv.conf to check the requested map.
  3. if a mapname doesn't match a rule, rpc.ypxfrd will look for the YP_SECURE key in the map.
  4. if that key exists, rpc.ypxfrd will only allow requests on a reserved port.

no shortcuts, no exceptions, no "but bestie I'm literally your favorite host". πŸ™ˆ


⚠️ NOTES ⚠️

the FreeBSD ypxfrd protocol is not compatible with the one used by SunOS. not a little incompatible. not "close enough". not compatible.

it's unfortunate but it's unavoidable: SUN's protocol is not freely available. and even if it were, it would probably not be useful, since the SunOS NIS v2 implementation uses the original ndbm package for its map databases, whereas the other implementation uses GNU DBM or Berkeley DB.

and those packages use vastly different file formats. so like. yeah. πŸ’€

furthermore β€” and this is the part that really gets me β€” ndbm and gdbm are byte-order and word width sensitive and not very smart about it. meaning that a gdbm or ndbm database created on a big endian or 64bit system cannot be read on a little endian or 32bit system. no cap. she just can't read it.

the good news: the FreeBSD ypxfrd protocol checks if both, master and slave, use the same database packages and, if necessary, the byte order of the system. so she knows. she's checking. πŸ‘‘


πŸ“ FILES πŸ“

  • /etc/ypserv.conf β€” configuration file for options and access rights
  • /var/yp/securenets β€” configuration file for access rights

πŸ‘€ SEE ALSO πŸ‘€

ypserv(8), makedbm(8), yppush(8), ypxfr(8)


πŸ’œ AUTHOR πŸ’œ

  • ypxfrd protocol and FreeBSD Implementation: Bill Paul <wpaul@ctr.columbia.edu>
  • Linux Implementation: Thorsten Kukuk <kukuk@linux-nis.org>

and that's the whole page, bestie β€” straight from the NIS Reference Manual, dated 12/31/2020. go forth and copy those map files. literally. that's what she's for. 🌈⭐πŸ’