NIS server set up under CentOS-7.6

Server configuration:

Server: 192.168.0.178(CentOS 7.6)

# systemctl stop firewalld
# systemctl disable firewalld
# sed -i 's/=enforcing/=disable/' /etc/selinux/config

NIS server installation

# yum install -y ypserv rpcbind yp-tools

Setting the NIS domain name

# nisdomainname nis.local
# echo "nisdomainname nis.local" >> /etc/rc.d/rc.local
# chmod +x /etc/rc.local
# echo "NISDOMAIN=nis.local" >> /etc/sysconfig/network
# echo "192.168.0.178 nis.local" >> /etc/hosts

Edit / etc / sysconfig / network file, set the service port is 1011 NIS

# sed -i 's/YPSERVER_ARGS=/YPSERVER_ARGS="-p 1011"/' /etc/sysconfig/network

Edit / etc / sysconfig / yppasswdd files, settings, password access port 1012

# sed -i 's/YPPASSWDD_ARGS=/YPPASSWDD_ARGS="--port 1012"/' /etc/sysconfig/yppasswdd

Setting allows the network can access the full segment:

# echo "192.168.0.0/24:*:*:none" >> /etc/ypserv.conf

Restart Service

# systemctl restart rpcbind
# systemctl restart ypserv
# systemctl restart yppasswdd

The service is set to boot from Kai

# systemctl enable rpcbind
# systemctl enable ypserv
# systemctl enable yppasswdd

Check the service is started:

# rpcinfo -p localhost

# rpcinfo -u localhost ypserv

Create a user generates a NIS database

# /usr/lib64/yp/ypinit -m

After each modify user, execute the following command to take effect without restarting the service

# make -C /var/yp

Client Configuration:
Client: 192.168.0.154 (RedHat 6.9), 192.168.0.155 (RedHat 6.7)

# yum install -y rpcbind yp-tools ypbind
# nisdomainname xynis.local
# echo "nisdomainname xynis.local" >> /etc/rc.local
# echo "NISDOMAIN=xynis.local" >> /etc/sysconfig/network
# echo "192.168.0.178 xynis.local" >> /etc/hosts

Modify /etc/nsswitch.conf, add NIS authentication service
in the passwd, shadow, group files hosts and back rows are added on nis.

Modify / etc / sysconfig / authconfig file, USENIS = no change USENIS = yes

# sed -i 's/USENIS=no/USENIS=yes/' /etc/sysconfig/authconfig

/Etc/pam.d/system-auth modify the file, the password sufficient line, inserted in the back shadow nis

Configuring NIS server IP address

# echo "domain nis.local server 192.168.0.178" >> /etc/yp.conf

Restart Service

# service rpcbind restart
# service ypbind restart

Note: If ypbind fails to start, you need to set up a firewall (iptables or firewall-cmd) on the next NIS server
set up and boot from Kai

# chkconfig rpcbind on
# chkconfig ypbind on

Guess you like

Origin www.cnblogs.com/DouglasHall/p/11005288.html