Chinaunix首页 | 论坛 | 博客
  • 博客访问: 64899
  • 博文数量: 12
  • 博客积分: 1148
  • 博客等级: 军士长
  • 技术积分: 131
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-14 17:14
文章分类
文章存档

2010年(12)

分类:

2010-08-05 14:49:32

利用NIS+AUTOFS+NIS实现集中管理网络计算机的用户账号信息,并能自动挂载其HOME目录
 

项目需求:(1)因服务器群以及内网用户数量较多,管理不便,需要统一管理用户账号。密码

          (2)实现当用户使用自己的账号在该环境中任意一台机器登陆时,自动挂载其home目录。展开工作

          (3)利用serveradmin管理服务器群内的所有服务器,外网所有用户不能连接nis服务器

实现方案:在服务器群中增加一台nis服务器,设置两个域,其中内网用户为locallan,服务器群为dmz,拒绝外网的用户连接nis服务器。

解决方案:

(一)Setting up a NIS Server

 The packages that are required for setting up a NIS Server are: 

(1) - ypserv  

    - ypbind

    - portmap

    - yp-tools 

(2)The NIS domain needs to be added in the /etc/sysconfig/network file. Edit the file and add the following line to the end of the file:  

 NISDOMAIN="DOMAIN-NAME" 

Replace DOMAIN-NAME with the actual domain name of the server. 
 

(3)The NIS Server also needs to be set up as a client. Edit the /etc/yp.conf file and add the following line: 

 ypserver 127.0.0.1 

(4)Start the following daemons: portmap, yppasswdd, and ypserv.  
  
 (5)The next step is to generate the NIS database:  
   /usr/lib/yp/ypinit -m 

 (6) authconfig-tui  

This lets the user to specify the NIS domain and the NIS Server. Enter the domain name as the one which is used previously and localhost as the NIS server.

(7)The services ypbind and ypxfrd can be started by executing the command: 

 service start 

The above steps complete the steps to configuring a master NIS Server.

(8)vim /etc/ypserv.conf

# Host                     : Domain  : Map              : Security
#
# *                        : *       : passwd.byname    : port
# *                        : *       : passwd.byuid     : port

(9)vim /etc/nsswitch.conf

passwd:     files nis
shadow:     files nis
group:      files nis
hosts:      files nis dns

(二)Setting up a NIS Client

The following packages are required for setting up a client 

- ypbind  

- yp-tools 

Perform the following steps to configure the NIS client:

 

Execute the command:  
  authconfig

This will let you specify the NIS domain and the NIS Server.  

Start the ypbind services by executing the following commands:  
   chkconfig ypbind on

 service ypbind start

The above procedure is a simple example of setting up an NIS Server and Client

 

(三)setup nfs

(1) yum -y install nfs-utils

(2)add users

useradd -d /rhome/RedHat2001 redhat2001

useradd -d /rhome/RedHat2002 redhat2002

(3) vim /etc/exports

/rhome           *(rw,sync,root_squash)

(4)service nfs restart

(四)on_the_client----(4)vim /etc/auto.master

/rhome      /etc/auto.nis

on_the_client----(5) vim /etc/auto.nis

*          192.168.1.254:/rhome/&

on_the_client----(6)mkdir /rhome

on_the_client--(7)service autofs restart

阅读(2624) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~