LINUX下搭建内部文件服务器(1)


建议先将防火墙停用和selinux服务停用再做如下配置

NIS服务端配置步骤:

1. rpm -qa |grep ^yp 查看系统是否把pybind-1.17.2-3 yp-tools-2.8-7这两个软件包装上了。

rpm -q portmap 查看系统是否把该包也装上了。因为NIS与NFS一样需要portmap服务的支持)

2.安装ypserv软件包第一张光盘)

rpm -ivh ypserv-2.13-5.i386.rpm

3.设置time 和 time-udp服务为启动状态

chkconfig time on

chkconfig time-udp on

service xinetd restart启动依赖于xinetd的服务都要将它重新启动才会生效)

4.建立NIS域名nisdomainname nistest 这里使用nisdomainname命令建立的nistest域名是临时生效的,要想永久生效需要写入配置文件)

vi /etc/rc.d/rc.local 在最后添加一行 /bin/nisdomainname nistest 也可以使用这条命令将内容导入追加进去:echo '/bin/nisdomainname nistest' >> /etc/rc.d/rc.local 这样与编辑rc.local是同样的效果。

同时还需要在/etc/sysconfig/network文件中写入一行 NISDOMAIN=nisdomain 的记录,可以使用VI编辑,也可以使用追加

echo 'NISDOMAIN=nistest' >> /etc/sysconfig/network

5.修改主配置文件 ypserv.conf

设置访问控制记录第二重验证)

在# under MSDOG everbody is root and can access port > /etc/hosts

3.建立NIS的域名nisdomainname nistest  (服务器上叫什么域名、客户机上也必须一样。) echo '/bin/nisdomainname nistest' >> /etc/rc.d/rc.local

echo 'NISDOMAIN=nistest' >> /etc/sysconfig/network

4.设置yp.conf配置文件echo 'domain nistest server NISserver' >> /etc/yp.conf

(其中nistest是NIS域名NISserver是NIS域名服务器的主机名)

5.设置nsswitch.conf文件 设置系统中信息的查询方式 在原来的files后都加上nis

passwd: files

shadow: files (原)

group: files

hosts: files dns

passwd: files nis

shadow: files nis (修改后)

group: files nis

hosts: files dns nis


相关内容