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