Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2280778
  • 博文数量: 168
  • 博客积分: 6641
  • 博客等级: 准将
  • 技术积分: 1996
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-02 11:49
文章存档

2020年(4)

2019年(6)

2017年(1)

2016年(3)

2015年(3)

2014年(8)

2013年(2)

2012年(12)

2011年(19)

2010年(10)

2009年(3)

2008年(17)

2007年(80)

分类: LINUX

2007-06-02 13:08:14

NIS服务器配置提纲
kenthy#qingdaonews.com 2006.11.09
系统环境: Thizlinux Server 7.0
软件版本:
 ypserv-2.8-2Thiz、ypbind-1.11-2Thiz、portmap-4.0-46Thiz
##################################################################################### 
PS: 只允许本地用户和名为nisuser的nis用户登陆客户端
实现:
 1、编辑 /etc/pam.d/system-auth,顺序增加两行
  account  sufficient  /lib/security/pam_localuser.so
  account  required  /lib/security/pam_listfile.so item=user sense=allow file=/etc/nisusers onerr=fail
 2、编辑 /etc/nisusers,增加一行
  nisuser
 3、chmod 600 /etc/nisusers
*************************************************************************************
1.  NIS主服务器端:
IP地址:192.168.1.254
主机名:nis.example.org
配置摘要:
 #nisdomainname  example.org
 #vi  /etc/sysconfig/network
  NETWORKING=yes
  HOSTNAME=nis.example.org
  NISDOMAIN=example.org
 #vi  /etc/hosts
  192.168.1.254 nis.example.org nis
 #vi  /var/yp/Makefile
  #B=-b
  NOPUSH=true
  MINUID=500
  MINGID=500
  NFSNOBODYUID=65534
  NFSNOBODYGID=65534
  MERGE_PASSWD=true
  MERGE_GROUP=true
 #/usr/lib/yp/ypinit  -m
  next host to add: nis.example.org
 #vi  /etc/ypserv.conf
  # host:domain:map:security
  192.168.1.0/255.255.255.0 : * : * : none
 #/etc/init.d/portmap  start
 #/etc/init.d/ypxfrd  start
 #/etc/init.d/ypserv  start
 
 #chkconfig --level 35 portmap on
 #chkconfig --level 35 ypxfrd on
 #chkconfig --level 35 ypserv on
2. NIS测试客户端:
IP地址: 192.168.1.10
主机名:
配置摘要:
 #nisdomainname  example.org
 #vi  /etc/sysconfig/network
  NETWORKING=yes
  HOSTNAME=
  NISDOMAIN=example.org
 #vi  /etc/hosts
  192.168.1.254 nis.example.org nis
 #vi  /etc/yp.conf
  domain example.org server nis.example.org
  domain example.org broadcast
  ypserver nis.example.org
 
 #/etc/init.d/portmap  start
 #/etc/init.d/ypbind  start
 
 #ypwhich
 #ypcat  passwd
 
 #vi  /etc/nsswitch.conf
  passwd:    nis files
  shadow:    nis files
  group:      nis files
  hosts:      files  dns
  
 #chkconfig --level 35 portmap on
 #chkconfig --level 35 ypbind on
 
3. 需要时增加一台NIS从服务器
A.  NIS-Master服务器:
IP地址: 192.168.1.254
主机名: nis.example.org
配置摘要:
 #修改 /var/yp/Makefile 文件
  NOPUSH=false
 #/usr/lib/yp/ypinit  -m
  next host to add: nis.example.org
  next host to add: nis-sl.example.org
 #/etc/init.d/ypserv  restart
 
B.  NIS-Slave服务器:
IP地址: 192.168.1.253
主机名: nis-sl.example.org
配置摘要:
 #vi /etc/hosts
  192.168.1.254  nis.example.org  nis
 #vi /etc/sysconfig/network
  NETWORKING=yes
  HOSTNAME=nis-sl.example.org
  NISDOMAIN=example.org
 #/usr/lib/yp/ypinit  -s  nis.example.org
 #/etc/init.d/portmap  start
 #/etc/init.d/ypxfrd  start
 #/etc/init.d/ypserv  start
 #/etc/init.d/ypbind  start
 
 #chkconfig --level 35 portmap on
 #chkconfig --level 35 ypxfrd on
 #chkconfig --level 35 ypbind on
 #chkconfig --level 35 ypserv on
 
C.  NIS客户端:
 #vi  /etc/yp.conf
  domain example.org server nis.example.org
  domain example.org server nis-sl.example.org
  domain example.org broadcast
  ypserver nis.example.org
 #/etc/init.d/ypbind restart
阅读(774) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~