Tuesday, 14 August 2012

configure an NIS server to provide directory services

[root@ds1 ~]# yum install ypserv

[root@ds1 ~]# chkconfig portmap on

add the following to iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT

add the following to /etc/sysconfig/network

YPSERV_ARGS="-p 841"

add the following to iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 808 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 808 -j ACCEPT

Set the NIS domain name

[root@auth1 ~]# nisdomainname NISDOMAINNAME

Start NIS

[root@auth1 ~]# service ypserv start

Initialise maps

[root@auth1 /]# /usr/lib/yp/ypinit -m

check access to maps

[root@client ~]#  ypcat  -d auth1.example.com -h auth1.example.com passwd

Lock down using securenets

[root@auth1 /]# vim /var/yp/securenets
SUBNETMASK NETWORKADDRESS


1 comment:

  1. YPSERV_ARGS="-p 841" doesn't correspond to the --dport iptables rule.

    Either change YPSERV_ARGS to "-p 808" or set --dport 841 in bot cases.

    ReplyDelete