中文版:
配置NIS Master Server:
1. 把 /var/yp 加入到root的环境变量 PATH 中。因为/var/yp目录包含'ypmake'命令。
方法:把以下一行添加到 /.profile 的末尾:
export PATH=$PATH:/var/yp
2. 检查以下文件,确认其内容是正确的。因为这些文件将被转化进入 NIS maps:
For example: /etc/passwd, /etc/group, /etc/hosts, and so on.
3. 手工设置 domain name:
#/usr/bin/domainname 您的域名
4. 编辑 /etc/rc.config.d/namesvrs 中的以下内容:
NIS_DOMAIN="您的域名"
NIS_MASTER_SERVER=1
NIS_CLIENT=1
5. 创建 NIS Master Server:
#ypinit -m
Note: 'ypinit -m' allows you to interactively add the names of
the slave servers in your NIS domain.
6. 启动 NIS Server:
#/sbin/init.d/nis.server start
7. 启动 NIS Client:
#/sbin/init.d/nis.client start
配置 NIS client:
1. Edit the /etc/rc.config.d/namesvrs
Change the line that starts with: NIS_CLIENT=0
To: NIS_CLIENT=1
Change the line that starts with: NISDOMAIN=""
To: NIS_DOMAIN="您的域名"
2. /sbin/init.d/nis.client start
3. /sbin/init.d/nis.client stop
4. 检查 NIS client 是否已经与 NIS server 连接上:
ypwhich (NIS server name will print)
Note: It may take up to a minute to bind to an NIS server
that returns the 'domain mydomain.com not bound'
message. If you get this message, retry the ypwhich
a few more times.
-----Original Message-----
From: Zeng, Wen-Bin (TSDO-GSC-China)
Sent: Friday, July 20, 2007 10:06
To: 'herryin@foxconn.com'
Subject: TO 程林:NIS 配置
以下是一个英文的步骤,你先参考一下,随后我再给你一个中文的:
Perform. the following steps to configure an NIS Master Server:
1. Add /var/yp directory to root's PATH variable. This directory
contains the 'ypmake' command to update maps.
This can be accomplished by adding the following line to the
end of any dot file (for example, .profile) that is sourced
by root at login:
export PATH=$PATH:/var/yp
2. Check all source files that will be coverted into NIS maps to
make sure they are up to date. Make the changes before you
convert the system to a master server.
For example: /etc/passwd, /etc/group, /etc/hosts, and so on.
3. Manually set the domain name:
#/usr/bin/domainname XXXXXXXX
4. Edit /etc/rc.config.d/namesvrs to contain the following
variable assignments:
NIS_DOMAIN="domain" <=replace domain with your domain name
NIS_MASTER_SERVER=1
NIS_CLIENT=1
5. #ypinit -m
Note: 'ypinit -m' allows you to interactively add the names of
the slave servers in your NIS domain.
6. #/sbin/init.d/nis.server start
7. #/sbin/init.d/nis.client start
Perform. the following steps to configure an NIS Slave Server:
1. #domainname DOMAIN <=replace DOMAIN with your domain name
2. Edit /etc/rc.config.d/namesvrs to contain the following
variable assignments:
NIS_DOMAIN="domain" <=replace domain with your domain name
NIS_SLAVE_SERVER=1
NIS_CLIENT=1
3. Remove all user entries to be maintained via NIS from
/etc/passwd and /etc/group.
Note: Do not remove the root entry.
4. Add the appropriate escape sequences to the end of the
/etc/passwd and /etc/group files. HP recommends the
following escape sequences:
/etc/passwd: +::-2:60001:::
/etc/group: +:*:*
5. # ypinit -s ipaddress_of_master
6. # /sbin/init.d/nis.server start
7. # /sbin/init.d/nis.client start
Perform. the following steps to configure an NIS client:
Note: You cannot use SAM to configure NIS.
1. Add '+' entries to 'escape' /etc/passwd to NIS:
Add the following entry after the 'local' passwords in
/etc/passwd:
+::0:0:::
Note: DO NOT PUT AN '*' in the password field! HP-UX assumes
that an '*' represents an invalid passwd file entry and
ignores it. Keep 'system' Users in the local /etc/passwd
file (for example, root and bin).
2. Add '+' entries to 'escape' /etc/group to NIS:
Add the following entry after the 'local' group IDs in
/etc/group:
+:
Note: Keep 'system' group IDs in the local /etc/group file
(for example, bin).
3. You do not need to add a '+' in the /etc/hosts file!
4. Edit the /etc/netnfsrc file:
Note: /etc/netnfsrc is a 9.x file.
/etc/rc.config.d/namesvrs is the correct configuration
file for HP-UX 10.x and 11.0.
Change the line that starts with: NIS_CLIENT=0
To: NIS_CLIENT=1
Change the line that starts with: NISDOMAIN=""
To: NISDOMAIN="mydomain.com"
Note: 'mydomain.com' is your NIS domain name. You are using
quotes in the event that the domain name contains a
special character. These changes will take effect
on the next boot.
To start the NIS client before your next boot:
1. Make sure that you are using the 'root' ID.
2. /sbin/init.d/nis.client start
3. /sbin/init.d/nis.client stop
4. Check to see if 'bound' to NIS server:
ypwhich (NIS server name will print)
Note: It may take up to a minute to bind to an NIS server
that returns the 'domain mydomain.com not bound'
message. If you get this message, retry the ypwhich
a few more times.
Best regards,
Zeng Wenbin
HP Response Center
与 NIS 相关的额外的设置:
/etc/nsswitch.conf
...
passwd: files nis
group: files nis
hosts: files nis
如果使用以上设置,那么主机允许本机定义的的user, group和host,同时也使用 NIS 的定义。
如果使用以下设置,那么主机只能使用本机定义的user, group和host,忽略NIS的定义:
passwd: files
group: files
hosts: files
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14876437/viewspace-598192/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14876437/viewspace-598192/
323

被折叠的 条评论
为什么被折叠?



