加入收藏
网站地图
网站搜索
阅读内容

RHCE专题学习之nis+nfs+autofs实现

[日期:2010-07-22] 来源:RHCE  作者:RHCE

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

 

RHCE专题学习之nis+nfs+autofs实现

项目需求:(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 <service- name> 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




相关资讯       RHCE 
本文评论       全部评论
发表评论

请您注意:
遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。
LinuxIDC.com拥有管理笔名和留言的一切权利。

点评: 字数
姓名: