NIS(yp)     不能两个一起做,做了客户端就不能做服务端,做服务端就不能做客户端 网络信息服务(yp)作用:共享用户(实现Linux用户的集中化管理)服务端:(ypserv)客户端:(ypbind)![](http://139.199.161.77/linhut/2017728_files/Image [1].png)

搭建serv端:![](http://139.199.161.77/linhut/2017728_files/Image [2].png)先设置开机启起,然后设置域名![](http://139.199.161.77/linhut/2017728_files/Image [3].png)![](http://139.199.161.77/linhut/2017728_files/Image [4].png)分别解释:(从上往下匹配)主 机/ip/网段          域名          用户那里找          安全性# Host                     : Domain  : Map              : Security## *                        : *       : passwd.byname    : port# *                        : *       : passwd.byuid     : port![](http://139.199.161.77/linhut/2017728_files/Image [5].png)#这里就是排除上面的其他全部拒绝启动服务,并创建用户![](http://139.199.161.77/linhut/2017728_files/Image [6].png)必须配置密码,不能登录(不然只能su过去)这里普通用户是不能修改密码的,必须开启yppassdd.service![](http://139.199.161.77/linhut/2017728_files/Image [7].png)用户需要加入域(并形成一个数据库),也类似于Windows的域控/usr/lib64/yp/ypinit -m#形成NIS数据库搭建客户端:()![](http://139.199.161.77/linhut/2017728_files/Image [8].png)图形化配置:![](http://139.199.161.77/linhut/2017728_files/Image [9].png)![](http://139.199.161.77/linhut/2017728_files/Image [10].png)ypcat  /etc/passwd     #查看是否接到用户bash搭建nfs服务端:![](http://139.199.161.77/linhut/2017728_files/Image [11].png)facl拷贝/etc/fstab到/var/tmp。要求用户属于root,组也属于root,没有一个人能对这个/var/tmp/fstab有执行权限,natasha用户对这个文件有可读可写的权限;harry既不能读也不能写;其他人现在或者将来都只有读的权限 chown root:root fstab chmod 644 fstab setfacl -m u:natasha:rw fstab setfacl -m u:harry:0 fstab-m   是添加-x   是移除 getfacl   #查看添加的权限递归: setfacl -m d:u:harry:rwx fatab   #d==default![](http://139.199.161.77/linhut/2017728_files/Image [12].png) 视频链接: 链接: http://pan.baidu.com/s/1skTbhFZ 密码: 7yse