Preparation 2 virtual machines.

1. test two computer`s ip, hostname, and network configuration.

hostname

network

ip

 

server.ls.com

HOSTNAME=server.ls.com

192.168.0.5/24

 

server.lc.com

HOSTNAME=server.lc.com

192.168.0.6/24

 

make sure the two computers can ping each other`s ip

2.install ypserv on server.lc.com

yum install –y ypserv

vim /etc/ypserv.conf

change the last line, delete# at the beginning to open the listening port

service ypserv start

/usr/lib/yp/ypinit –m

service ypserv restart

3. Set the ypbind on server.ls.com

authconfig –enablenis –nisdomain=server.lc.com –nisserver=192.168.0.254 –update

make sure selinux enable ypbind

setsebool -P allow_ypbind=1

now restart ypbind

service ypbind restart

to see if it is working properly

4.create some users on server.lc.com , change their passwords, then use server.ls.com login those users

[root@ls ~]# ssh tonyp@server.ls.com
tonyp@server.ls.com’s password:
Last login: Sun May 30 22:52:14 2010 from server.ls.com
Could not chdir to home directory /home/tonyp: No such file or directory

we can see user tonyp-which is a user of server.lc.com can login server.ls.com through NIS. And because there is no NFS settings yet user tonyp can not find its home dir on server.ls.com.

Done.

Advertisements