Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1802387
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: LINUX

2007-04-06 13:40:41

要求
   NIS客户端自动挂载/home目录
 
前提
====
  1)两台电脑
     server:192.168.1.2
     clinet:192.168.1.117
  2)服务器端(server)假定已安装包:ypserv,portmap,nfs等
    客户端(server)假定已安装包:ypbind,portmap,autofs等
 
配置
====
一.服务器(server)端配置
 1)ypserv配置 
   1.修改/etc/sysconfig/network文件
     echo "NISDOMAIN=myNIS" >> /etc/sysconfig/network
   2.修改/var/yp/Makefile(可选)
     all:  passwd group hosts (其后内容可以注释掉)
   3.开启portmap,ypserv服务
     chkconfig --level 345 portmap on
     service portmap start
     chkconfig --level 345 ypserv on
     service ypserv start
   4.建nis主服务器
 注:按control+D
[root@test ~]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers.  test.example.com is in the list of NIS server hosts.  Please continue to add the names for the other hosts, one per line.  When you are done with the
list, type a <control D>.
        next host to add:  test.example.com
        next host to add: 
The current list of NIS servers looks like this:
test.example.com
Is this correct?  [y/n: y]  y
We need a few minutes to build the databases...
Building /var/yp/myNIS/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/myNIS'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
gmake[1]: Leaving directory `/var/yp/myNIS'
test.example.com has been set up as a NIS master server.
Now you can run ypinit -s test.example.com on all slave server.
2)建立/home目录软件链接   
  ln -s /home  /rhome
 
3)配置导出文件
  1.开启nfs服务
    chkconfig --level 345 nfs on
    service nfs restart
 
  2.修改/etc/exports文件
  echo "/rhome       192.168.1.117(rw,sync)
  :rw就是导出文件系统对主机192.168.1.117可写;
    192.168.1.117(rw,...与192.168.1.117 (rw,...  {后面一个多一个空格}
 
  3.生效exports
    exportfs -r
 
二.客户(client)端配置
 1)ypbind配置
  1.开启portmap,autofs,ypbind
     chkconfig --level 345 portmap on
     service portmap start
     chkconfig --level 345 autofs on
     service autofs start
     chkconfig --level 345 ypbind on
     service ypbind  start
 
   2.nis客户端配置
      authconfig
         Domain: myNIS
         Server: 192.168.1.2
 
   3.验证帐户信息
     ypcat passwd
 
  2)自动挂载导出文件系统
   1.修改/etc/auto.master
     echo "/rhome        /etc/auto.rhome  --timeout=60" >> /etc/auto.master
  
   2.修改/etc/auto.rhome
     echo "*  -rw,soft            192.168.1.1:/rhome/&" >> /etc/auto.rhome
     注:此处rw与上面rw具体相同含义,均指可写文件系统
 
三.测试
   server上定义mail01,mail02用户,在client上用mail01/mail02登录,没有错误:说明共享主目录成功,mail01/mail02登录后,可在自己的主目录写(取决于上面两处注红色的"rw")
 
   测试成功!!!!
 
 
    
 
nis+aufs+pam案例:
 

  
  
 
 
       
   
阅读(2105) | 评论(0) | 转发(0) |
0

上一篇:沁园春·雪

下一篇:tcpdump用法

给主人留下些什么吧!~~