#!/bin/bash echo sudo cp ~/config/nis/defaultdomain /etc/defaultdomain sudo cp ~/config/nis/defaultdomain /etc/defaultdomain # 编辑/etc/default/nis,将NISCLIENT=false改为true echo sudo cp ~/config/nis/nis.client /etc/default/nis sudo cp ~/config/nis/nis.client /etc/default/nis # 编辑/etc/yp.conf,指定nis服务器 echo sudo cp ~/config/nis/yp.conf /etc/yp.conf sudo cp ~/config/nis/yp.conf /etc/yp.conf # 编辑/etc/nsswitch.conf,注释原有的passwd、shadow、group,增加以下内容 echo sudo cp ~/config/nis/nsswitch.conf /etc/nsswitch.conf sudo cp ~/config/nis/nsswitch.conf /etc/nsswitch.conf sudo systemctl stop ypbind echo sudo systemctl start ypbind sudo systemctl start ypbind echo sudo systemctl enable ypbind sudo systemctl enable ypbind sleep 3 echo sudo systemctl status ypbind sudo systemctl status ypbind