前些天给集群配置了NIS+NFS,混合Linux和Solaris,简单地记录了一下,以便日后查阅。
NFS+NIS in Linux and Solaris
Pre:
/etc/hosts
NFS server:
Linux:
/etc/exports
exportfs -v
NFS client:
mount -t nfs server:/home /home
mount -F nfs -vers=3 server:/home /home
NIS Server
Linux NIS Server:
# nisdomainname iwomp
# vi /etc/sysconfig/network
# 加入下面这一行:
NISDOMAIN=iwomp
修改/etc/nsswitch.conf文件:该文件用来配置使用哪些服务来确定诸如主
机名、口令以及组文件信息等,规定NIS客户端查询用户数据信息来源
的顺序。在该文件中编辑如下内容:
passwd:files nis
shadow:files nis
group: files nis
hosts: files nis dns
# vi /etc/ypserv.conf
# 最后一行
* : * : *: none
# touch /etc/netgroup
# /etc/init.d/portmap start
# /etc/init.d/ypserv start
# /etc/init.d/yppasswdd start
# /usr/lib(64)/yp/ypinit -m
# /etc/init.d/ypserv restart
# /etc/init.d/yppasswdd restart
#chkconfig --level 35 portmap on
#chkconfig --level 35 ypserv on
#chkconfig --level 35 yppasswdd on
----------------------------------
linux NIS client: authconfig
Solaris NIS client:
1、#cp /etc/nsswitch.nis /etc/nsswitch.conf
2、#vi /etc/hosts
10.1.100.2SUN-2 loghost
10.1.100.1 SUN-1
3、#domainname testdomain
4、#domainname >; /etc/defaultdomain
5、#ypinit –c
(when prompted for a list of NIS servers,enter the names of the NIS master
and all slave servers)
6、#/usr/lib/netsvc/yp/ypstart
# ypwhich –m :如果能看到Master server的信息说明configure 成功
-----------------------------------------
6. 诊断
ypcat hosts
ypcat passwd
7.增加NIS用户:
login to nis server:admin
run
/var/yp/etc/adduser to add NIS users,
run /var/yp/etc/rsetpass to change Nis users password.
没有评论:
发表评论