NIS : Databases

Generating the NIS Database

Until now, we’ve basically been working with config files. Now we’re going to build one fast .db file that will actually provide information to the yp service.

1: On the NIS server, command:

/usr/lib/yp/ypinit -m

The result will be:

next host to add: your_server_name

in the case of our current example. Your current server thus has already been added. This will be followed by another line that lets you add a slave:

next host to add:

Type in the name of the first slave, if you’re using one or more. Press Enter and you’ll get the same line again, allowing you to add as many slaves as you want.

When you’re finally done (or immediately after the ypinit command, if you’re only using a single master), type CTRL+D to finish. If the list you now see is correct, type y (for yes) and you’re done. If you’ve mistyped a name you can type n (for no) and you’ll get a chance to correct it.

 

2: Check out the /var/yp directory. You should see a new subdirectory with the same name as your NIS domain, and within that directory are your maps.