Thursday 30 August 2018

Install, Configure and Use Linux NIS Server


Introduction
The Linux NIS server (Network Information Service) is a server used for sharing critical data stored in flat files between systems on a network, it is often ideal to have a common repository (such as NIS) for storing user and group information that is traditionally stored in flat files like /etc/passwd.
By making such files available via the NIS server, that would allow any remote NIS client machine to access or query the data in these shared files and use them as extensions to the local versions.
NIS is not limited to sharing files. Any tabular file which at least has one column with a unique value can be shared via NIS like /etc/services file.
The main benefit from using NIS server is that you keep your data and files, and if your data is updated, all updates be propagated to all users.


The following list is the list of services and tools that are used by NIS client/server:
ypserv: This service waits for queries and gives answers to NIS clients.
ypbind: This is client-side of NIS.
ypxfrd: This service is used for sending the NIS databases from master MIS servers to slave servers(not Used for time being as we are not using Master Slave Configuration).
yp-tools-2.14-5.el7.x86_64.rpm : This package is intsalled with ypbind.
xinetd-2.3.15-13.el7.x86_64.rpm: Prerequisiste package.
tokyocabinet-1.4.48-3.el7.x86_64.rpm : Prerequisiste package.



Installing Linux NIS Server/NIS Client:
rpm -ivh xinetd-2.3.15-13.el7.x86_64.rpm
rpm -ivh yp-tools-2.14-5.el7.x86_64.rpm
ypbind-1.37.1-9.el7.x86_64.rpm
rpm -ivh tokyocabinet-1.4.48-3.el7.x86_64.rpm
rpm -ivh ypserv-2.31-10.el7.x86_64.rpm

Configuring NIS Client 
1) /etc/yp.conf
domain cdotd server <<IP of NIS Server>>
ypserver <<IP os NIS server>>
2) /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dellSrv_42 (self hostname )
NISDOMAIN=cdotd (same as yp.conf)
3) /etc/nssswitch.conf
passwd: nis files sss
shadow: nis files sss
group: nis files sss

Running NIS Client
systemctl start xinetd.service
systemctl start ypbind.service
systemctl start yppasswdd.service
Note : Please check the following service are also running Via Setup utility in Linux (#setup).
Testing of NIS Client
ypwhich: gets the name of the Linux NIS server that is responding to your requests.

Configuring NIS Server
To run on Master NIS server
/usr/lib64/yp/ypinit -m

systemctl start ypserv.service
systemctl start yppasswdd .service
systemctl start rpcbind.service
systemctl start xinetd.service


Testing of NIS server
1) Add a user in NIS server
adduser rahul
passwd rahul
2) Add user in NIS server after that run the following command
make -C /var/yp
3) Make necessary changes in the NIS client files namely (/etc/yp.conf , /etc/nssswitch.conf , /etc/sysconfig/network) as mentioned in the client section.
4) Login in from a third machine to NIS client with the set password .Login should be successful.

1 comment:

  1. Procure microsoft office 2019 home & business, Step up with the new range of Microsoft Office, containing the 2019 versions of your favorite productivity software. Upgraded Word, Excel, PowerPoint and OneNote come with enhanced new time-saving features and a sleek, modern look.

    ReplyDelete

Create a New Virtual Machine

1.In the left pane, Click on the Hyper-V manager that you wish to host the new virtual machine. 2. In the right-hand Action pane, Click Ne...