Configuring NIS under Red Hat Linux

做了一个下午的NIS服务器 做的蛋都快碎了 最近忙 一直没更新 见谅。现与大家分享下午的成果,这个可是我找了好久找到的-.- 国内的文章很多都是错的 蛋疼 英文的 没翻译 大家凑合着看吧。

The following describes a procedure to set up NIS network name service under Red Hat Linux. This is geared toward a small intallation with only one domain. However, it should be fairly evident how to add more NIS domains. The NIS domain name has nothing to do with any DNS naming convention being used.

In these examples, the following conventions are used:
NIS domain: “internal”
Code or configuration file data: colored
Root prompt on NIS master server: master#
Root prompt on NIS client host: client#

Setting up a NIS master server:

Required packages: yp-tools ypbind ypserv portmap

Set up “time” service to run via inetd/xinetd, or configure xntpd, or otherwise make sure the host’s clock is synchronized.

Edit /etc/yp.conf:

Edit /etc/ypserv.conf:

Edit /etc/sysconfig/network:

Set NIS domain name:

Create file /var/yp/securenets:

Make sure the “portmap” service is running:

Portmap will need a rule in /etc/hosts.allow to allow access from localhost and any hosts that need to access NIS.

Start ypserv service:

Check that it’s listening:

You should see:

Initialize the NIS maps:

Specify local hostname, Ctrl-D, y, let finish.

Start up ypbind, yppasswdd, ypxfrd:

Set YP services to run on boot-up:

NIS client host setup

Required packages: yp-tools ypbind portmap

Edit /etc/sysconfig/network:

Edit /etc/yp.conf:

Edit /etc/hosts:

Set NIS domain-name:

Edit /etc/nsswitch.conf:

Make sure the portmap service is running:

The /etc/hosts.allow file will need rules allowing access from localhost and the NIS master server.

Start ypbind service:

Test it out:

网络安全攻防研究室( 信息安全小组收集整理.转载本文请著名原文地址及原作者版权信息。