Running an NIS master on a NetInfo master

Jun 16, '03 09:36:00AM

Contributed by: g_nix

I've put together an article about running an NIS master from a NetInfo master.

This may be of use to people who want to create simple NAS type devices using Linux which need to share configuration information with OS X machines without the overhead of LDAP.

[robg adds: The host machine linked above was quite slow when I loaded it this morning (perhaps due to the US -> UK connection?), so I've recreated the text of the article in the main body of the hint, as well as hosted the download file that's mentioned in the article (both with g_nix's permission, of course!). Read the rest of the hint to see the entire article...]

Why run NIS on OS X

In a mainly OS X environment, where directory information is stored in NetInfo, introducing a single Linux machine brings a raft of headaches as far as authentication information is concerned. One has to either move to LDAP based directory information, or manually synchronise the account databases between the systems. Running an NIS master on the OS X netinfo master make Linux (and other UNIX) integration trivial.

How to run NIS on OS X

Download this Makefile (right click or control-click and Save Target / Download Link, etc), and replace the existing /var -> yp -> Makefile.yp with it. Remember to backup the existing Makefile.main if you wish to return to the defaults.

Open the Makefile.main in your favourite editor. At the top are the configurable options - MINUID, MINGID and NETINFODOMAIN. Configure these as required:

To configure the the NIS maps, run (sudo or as root) /usr/sbin/ypinit.sh -m domainname (where domainname is the NIS domainname you wish to use). Then cd to /var/yp/domainname and run make. To activate the NIS system, edit /etc/hostconfig to set NISDOMAIN to the same value as you chose for domainname above, and restart your computer. To check that it works, try ypcat passwd at a command line. Your password info should now be dumped to the screen.

Known Problems

The automounter maps don't yet work. This is because I am still figuring out how to convert OS X automount info to amd style mountmaps. In the meantime, all nfs exported home directories need to be manually mounted on the Linux system. There is no timestamp information, so the maps will be regenerated every time make is run in the /var/yp/domainname. This isn't a problem with small nis maps.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030612062231633