RHCE topic learning-Implementation of nis + nfs + autofs

Source: Internet
Author: User
Using NIS + AUTOFS + NIS to centrally manage user account information of network computers and automatically mount their HOME directories, project requirements: (1) a large number of Server Clusters and Intranet users, management is inconvenient. You need to manage your account in a unified manner. Password (2) Automatically

Using NIS + AUTOFS + NIS to centrally manage user account information of network computers and automatically mount their HOME directory,

 

Project requirements: (1) because of the large number of Server Clusters and Intranet users, management is inconvenient and user accounts must be managed in a unified manner. Password

          (2) The home directory is automatically mounted when you log on to any machine in the environment using your account. Expand work

         (3) Use serveradmin to manage all servers in the server group. All users on the Internet cannot connect to the nis server.

Implementation solution: add an nis server to the server group and set two domains. The intranet user is locallan and the server group is dmz. The Internet user is denied from connecting to the nis server.

Solution:

(1)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 previusly 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 keep ing 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

(2)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

 

(3) 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

(4) 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.