63.4 Using NIS
NIS is used to share password files among a collection of machines. This ensures all users have access to all machines and have the same user id and group ids. The group of machines is referred to with a domain name (nothing to do with a network domain name though). One machine in the group must be a master server and the rest are nis clients of that server. You can also have slave servers but we’ll ignore that one for now.
22.214.171.124 Setting Up The Master Server
To set up the master NIS server on Caravan:
caravan$ wajig install nis
You will be asked to name the nis domain. You can call it anything
and later edit it in
/etc/defaultdomain. Let’s call it
ktnet (it has no formal relationship to the
network domain name).
%% Since NIS does not use DNS make sure all hosts on the network are
%% properly listed in
/etc/hosts as in:
%% 127.0.0.1 localhost %% 126.96.36.199 velox.togaware.com alpine %% 188.8.131.52 prefect.togaware.com prefect %% 184.108.40.206 cepheus.togaware.com cephz %% 220.127.116.11 plymouth.togaware.com plymz %% ``` In the file `/etc/default/nis` set `NISSERVER=master` to identify `caravan` as the master server. To restrict who can access you NIS server add your local network number to the file `/etc/ypserv.securenets`:
# Restrict to local network 255.255.255.0 192.168.0.0
The password files on the server do not need to be changed.
Now restart the NIS server:
$ wajig restart nis
Set up the server:
# /usr/lib/yp/ypinit -m
You will be asked to list all of your servers (just caravan for now).
This essentially builds the maps from the current password file on caravan. Note that you can’t use the nis maps on caravan itself - don’t remove the users from caravan’s password file!
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0