Building NIS service on CentOS 8

 @Server

#### $ is prompt character

$dnf install ypserv rpcbind   #download and install yp packages

$vim /etc/hosts

192.168.0.200  nis.gplab nis

192.168.0.1  node1.gplab node1

192.168.0.2  node2.gplab node2

$ypdomainname  gplab # setup ypdomainname

$vim /etc/sysconfig/network

NISDOMAIN=gplab

HOSTNAME=nis.gplab

YPSERV_ARGS="-p 1001"

YPXFRD_ARGS="-p 1002"

$vim /etc/sysconfig/yppasswd

YPPASSWDD_ARGS="--port 1003"

$vim /var/yp/securenets

255.0.0.0 127.0.0.0

255.255.0.0 192.168.0.0

$systemctl enable rpcbind ypserv ypxfrd yppasswdd nis-domainname

$/user/lib64/yp/ypinit -m  # initialization yp

$cd /var/yp    # if you add new users, please execute command again

$make           # if you add new users, please execute command again

$setsebool -P nis_enable on         #SELinux policy

$setsebool -P domain_can_mmap_files on

$firewall-cmd --add-service=rpc-bind --permanent  #firewall pass through

$firewall-cmd --add-port={1001-1003/tcp,1001-1003/udp} --permanent

$firewall-cmd --reload

$systemctl restart rpcbind ypserv ypxfrd yppasswdd nis-domainname

------------------------------------

@Client node1

$dnf install rpcbind ypbind oddjob-mkhomedir

$ypdomainname gplab

$vim /etc/sysconfig/network

NISDOMAIN=gplab

HOSTNAME=node1.gplab

$vim /etc/yp.conf

domain gplab server nis.gplab

$autoselect select nis --force

$autoselect enable-feature with-mkhomedir

$setsebool -P nis_enable on

$systemctl enable ypbind oddjobd nis-domainname

$systemctl restart ypbind oddjobd nis-domainname

$ypwhich

$yptest

## exit root and login node1 by yp user

 #if you want to change password on node1

$yppasswd


references

https://www.server-world.info/en/note?os=CentOS_8&p=nis&f=1

https://www.server-world.info/en/note?os=CentOS_8&p=nis&f=2

這個網誌中的熱門文章

取消Excel與word網際網路與網路路徑超連結自動格式

Installing VMware workstation pro on Ubuntu 22.X (Jammy Jellyfish)