Related packages: ypserv (required for NIS servers) ypbind (required for NIS clients, installed by default), YP-tools (commonly used NIS tools, installed by default)
NIS Server: 192.168.100.114 hostname: localhost
NIS client: 192.168.100.115 hostname: linux211
Server Installation
[[Email protected] ~] # Yum install ypserv
[[Email protected] ~] # Mkdir/opt/nishome
Specify the NIS domain for the NIS Server
[[Email protected] # Vim/etc/sysconfig/Network
Hostname = localhost. localdomain
Nisdomain = a.com
View NIS Domains
[[Email protected] # nisdomainname
Add to NIS domain
[[Email protected] # nisdomainname a.com
Add to NIS domain at startup
[[Email protected] # echo "/bin/nisdomainname a.com">/etc/rc. Local
Start ypserv
[[Email protected] # service ypserv start
[[Email protected] #/usr/lib/yp/ypinit-M # generate an NIS database. After each user is added, the NIS database must be regenerated.
[[Email protected] # cd/var/yp will have a directory named by the domain name to generate Hui
Restart ypserv Service
On the server side of NIS
Share the NIS home directory using NFS
[[Email protected] # vi/etc/exports
/Opt/nishome * (RW)
NIS client
Set the shared directory to auto mount
[[Email protected] ~] # Vi/etc/auto. Master
/Opt/nishome/etc/auto. Misc
/Net-hosts
[[Email protected] ~] # Vi/etc/auto. Misc
*-Fstype = NFS 192.168.100.114:/opt/nishome/& # The home directory is automatically mounted to everyone. You can also specify the user)
[[Email protected] ~] #/Etc/init. d/autofs restart # restart the service