Setup the master server for NIS

本文详细介绍了如何设置NIS主服务器,包括配置文件修改、数据库更新等步骤,并展示了配置过程中的关键命令行操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值