LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   NIS Server configuration (https://www.linuxquestions.org/questions/linux-server-73/nis-server-configuration-622486/)

soumalya 02-20-2008 07:41 AM

NIS Server configuration
 
Sir i have configured NIS server

pls check if i am wrong anywhere

NIS Server Configuration
Machine name: redtest.com , dnsname:test.com ip:192.168.20.1 user=soumalya
# nisdomainname test
# vi /etc/yp.conf
domain test server 192.168.20.1
# vi /etc/nssswitch.conf
passwd: files nis
shadow: files nis
group: files nis
# vi /etc/ypserv.conf
dns : no
*: shadow.byname : port
*:passwd.adjunct.byname : port
*:*:*: none
# vi /var/yp/securenets (to create securenets file and edit)
255.255.255.255 127.0.0.0
255.255.255.0 192.168.20.0
# service portmap restart
# chkconfig protmap on
# rpcinfo -u localhost
# service ypserv restart
# chkconfig ypserv on
# rpcinfo -u redtest portmapper
# rpcinfo -u redtest ypserv
# /usr/lib/yp/ypinit -m
next host to add: redtest.test.com
next host to add: NIS Client name
next host to add: NIS Client ip
ctrl+D
is this correct? y
# service yppasswdd restart
# chkconfig yppasswdd on
# rpcinfo -u redtest yppasswdd
# vi /etc/sysconfig/network
NISDOMAIN=test
# cd /var/yp
# make
# service ypbind restart
# chkconfig ypbind on
#rpcinfo -u localhost ypbind
# vi /etc/exports (to share ditectory)
/home 192.168.20.0/24(rw,sync)
/home *(rw,sync)
# exportfs –a
# exportfs –v
# chkconfig nfslock on
# chkconfig nfs on
# service nfslock restart
# service nfs restart
# reboot
NIS Slave Server (server name : pinktest.com)
# vi /etc/hosts
192.168.20.3 pinktest.com (in master server)

# vi /etc/hosts
192.168.20.1 redtest.com (in slave server)

In slave server

# vi /etc/sysconfig/network
NISDOMAIN=test
# service portmap start
# service ypbind start
# service ypserv start
# service yppasswdd start
# service ypxfrd start

In Master Server

# service ypxfrd start

In slave server
# ypwhich –m
# usr/lib/yp/ypinitt –s 192.168.20.1


In Master Server

# vi /var/yp/ypservers
redtest
pinktest
#cp Makefile Makefile.old
# vi /var/yp/Makefile
NOPUSH=false
# make

In slave server
# vi /etc/exports (to share ditectory)
/home 192.168.20.0/24(rw,sync)
/home *(rw,sync)
# exportfs –a
# exportfs –v
# chkconfig nfslock on
# chkconfig nfs on
# service nfslock restart
# service nfs restart
# reboot
NIS CLIENT Configuration (ip:192.168.20.2)
# nisdomainname test
# ypserv 192.168.20.1
# vi /etc/yp.conf
domain test server 192.168.20.1
domain test server 192.168.20.2
# authconfig
select NIS
next
NIS Domain:test
NIS Server:192.168.20.1
# vi /etc/yp.conf
last line shows
domain test server redtest
# service ypbind restart
# chkconfig ypbind on
# service yppasswdd restart
# chkconfig yppasswd on
# service portmap restart
# chkconfig protmap on
# rpcinfo -u localhost
# service ypserv restart
# chkconfig ypserv on
# rpcinfo -u redtest ypbind
# ypcat passwd.byname
# vi /etc/host.conf
order hosts , nis , bind
# vi /etc/nssswitch.conf
passwd: files nis dns
shadow: files nis dns
group: files nis dns
hosts: files nis dns
# ypcat -x
# ypcat hosts
# chkconfig nfslock on (to mount server’s shared directory)
# service nfslock restart
# chkconfig netfs on
# service netfs restart
# chkconfig protmap on
# mount 192.168.20.1:/home /home
# mount 192.168.20.3:/home /home
# ls /home
# umount /home
# vi /etc/auto.master
/home /etc/auto.home (or auto.misc) –timeout=60
# vi /etc/auto.home (or auto.misc)
(Star sign) -fstype=nfs,soft 192.168.20.1:/home:&
(Star sign) -fstype=nfs,soft 192.168.20.1:/home:&


# chkconfig autofs restart
# service autofs restart
# showmount -e


All times are GMT -5. The time now is 03:48 PM.