Setup the master server for NIS

Setup the master server for NIS

# cd /var/yp
# ls
Makefile aliases binding nicknames updaters
# cp Makefile Makefile.orig
# domainname henry.com
# cd /etc
# domainname >defaultdomain
# cd /etc ; touch ethers bootparams netgroup
# vi /etc/timezone
US/Mountain henry.com
# vi /etc/auto_master
"/etc/auto_master" 11 lines, 248 characters
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)auto_master 1.8 03/04/28 SMI"
#
# Master map for automounter
#
#+auto_master
/net -hosts -nosuid,nobrowse
/home auto_home -nobrowse
* master_server:/export/home/&
# share -d "home dirs" /export/home
# ypinit -m

In order for NIS to operate sucessfully, we have to construct a list of the
NIS servers. Please continue to add the names for YP servers in order of
preference, one per line. When you are done with the list, type a <control D>
or a return on a line by itself.
next host to add: henry
next host to add: master_server
next host to add: slave_server
next host to add: ^D
The current list of yp servers looks like this:

henry
master_server
slave_server

Is this correct? [y/n: y] y

Installing the YP database will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.

Do you want this procedure to quit on non-fatal errors? [y/n: n] n
OK, please remember to go back and redo manually whatever fails. If you
don't, some part of the system (perhaps the yp itself) won't work.
The yp domain directory is /var/yp/henry.com
There will be no further questions. The remainder of the procedure should take
5 to 10 minutes.
Building /var/yp/henry.com/ypservers...
Running /var/yp /Makefile...
updated passwd
updated group
updated hosts
updated ipnodes
updated ethers
updated networks
updated rpc
updated services
updated protocols
updated netgroup
updated bootparams
/var/yp/henry.com/mail.aliases: 12 aliases, longest 10 bytes, 138 bytes total
/usr/lib/netsvc/yp/mkalias /var/yp/`domainname`/mail.aliases /var/yp/`domainname`/mail.byaddr;
updated aliases
updated publickey
updated netid
/usr/sbin/makedbm /etc/netmasks /var/yp/`domainname`/netmasks.byaddr;
updated netmasks
updated timezone
updated auto.master
updated auto.home
updated ageing
updated auth_attr
updated exec_attr
updated prof_attr
updated user_attr
updated audit_user

henry has been set up as a yp master server without any errors.

If there are running slave yp servers, run yppush now for any data bases
which have been changed. If there are no running slaves, run ypinit on
those hosts which are to be slave servers.
# svcs -a |grep nis |grep server
online 10:56:00 svc:/network/nis/server:default
# ypwhich -m
audit_user henry
user_attr henry
prof_attr henry
exec_attr henry
auth_attr henry
ageing.byname henry
auto.home henry
timezone.byname henry
netmasks.byaddr henry
netid.byname henry
publickey.byname henry
auto.master henry
mail.byaddr henry
mail.aliases henry
bootparams henry
netgroup.byhost henry
netgroup.byuser henry
netgroup henry
protocols.byname henry
services.byservicename henry
services.byname henry
rpc.bynumber henry
networks.byaddr henry
networks.byname henry
ethers.byname henry
ethers.byaddr henry
ipnodes.byname henry
ipnodes.byaddr henry
hosts.byaddr henry
hosts.byname henry
group.bygid henry
group.byname henry
passwd.byuid henry
protocols.bynumber henry
ypservers henry
passwd.byname henry

你可能感兴趣的:(server)