linux社区爱心援助Linux认证系列教程业界动态站务新闻公司招聘建议留言网址大全LPI专题CISCO专题
设为首页
加入收藏
管理团队
JSP  
JAVA  
PERL  
 您的位置:首页 > article > unix > unix入门 >
栏目导栏
资料搜索
热门文章
·SCO OpenServer系统手册
·solaris迅速查找手册
·UNIX常用命令-目录及文件操作命
·常见的“压缩与解压缩”方法
·SUN的入门培训资料
·Solaris FAQ 1.2
·UNIX系统操作入门篇
·unix大全下载基地
·教你如何配置安全的SOLARIS系统
·吐血奉献.samba安装设置!
·solaris常用命令及简单解释
·UNIX 常识总集~!
·Windows XP 与 Solaris 10 双操
·隆重推荐:Solaris硬盘分区简介
·UNIX基础知识
最新文章
·Solaris SSH的配置和管理介绍
·在Unix环境下mount ISO文件
·Solaris 管理员常用的168条命令
·solaris raid 制作大集合
·在Solaris下使用USB存储设备
·SecureCRT访问HPUX没办法用vi问
·scounix网络设置心得
·solaris网络配置
·solaris上直接运行linux二进制
·HP Unix的补丁安装
·系统备份与恢复命令:fbackup+
·Oracle 10g基于Solaris 9 x86平
·完全硬盘安装solaris10
·solaris点滴9.29-10.07
·solaris volume manager do RA
Google
 
nis下solaris和linxu的client.实现autofs
[ 作者:  加入时间:2006-06-25 15:10:08  来自: ]
这几天,做了试验 是用solaris做nis server和 client 用solaris和linux实现auto_home和autofs 84VLinux联盟
找了不少资料,都不完整,自己断断续续的写和装,可能有狠多错误. 84VLinux联盟
slave server 没做,是网上找的,因为现实用的不多,为了完整凑的 84VLinux联盟
84VLinux联盟
84VLinux联盟
NIS 管理域testdomain   84VLinux联盟
NIS master server ip address:  10.1.100.2 ,hostname:SUN-2   84VLinux联盟
NIS slave server ip address:  10.1.100.1 ,hostname:SUN-1   84VLinux联盟
84VLinux联盟
Default: NIS source files 存放在/etc目录下,这样map 的内容会与Master server的local files 相同,建议不要存放在/etc目录下。可通过修改/var/yp/Makefile,更改/etc换成你想要的directory。 84VLinux联盟
84VLinux联盟
84VLinux联盟
# Set the following variable to "-b" to have NIS servers use the domain 84VLinux联盟
name 84VLinux联盟
# resolver for hosts not in the current domain. 84VLinux联盟
#B=-b 84VLinux联盟
B= 84VLinux联盟
DIR =/etc 84VLinux联盟
# 84VLinux联盟
# If the passwd, shadow and/or adjunct files used by rpc.yppasswdd 84VLinux联盟
# live in directory other than /etc then you'll need to change the 84VLinux联盟
# following line. 84VLinux联盟
# DO NOT indent the line, however, since /etc/init.d/yp attempts 84VLinux联盟
# to find it with grep "^PWDIR" ... 84VLinux联盟
# 84VLinux联盟
PWDIR =/etc 84VLinux联盟
DOM = `domainname` 84VLinux联盟
NOPUSH = "" 84VLinux联盟
ALIASES = /etc/mail/aliases 84VLinux联盟
YPDIR=/usr/lib/netsvc/yp 84VLinux联盟
84VLinux联盟
NIS Master Server  ---------solaris 84VLinux联盟
1、#cp /etc/nsswitch.nis /etc/nsswitch.conf   84VLinux联盟
2、#domainname testdomain   84VLinux联盟
3、#domainname >; /etc/defaultdomain   84VLinux联盟
84VLinux联盟
4、#vi /etc/hosts   84VLinux联盟
10.1.100.2 SUN-2 84VLinux联盟
5、# vi /etc/auto_home   84VLinux联盟
SUN-2:/export/home/&(如果 不配置slave server 可以不写)   84VLinux联盟
6、#touch /etc/ethers /etc/bootparams /etc/netgroup /etc/netmasks.  (系统不能建立,不建立可能报错)   84VLinux联盟
84VLinux联盟
84VLinux联盟
7、#ypinit –m   84VLinux联盟
    In order for NIS to operate successfully, we have to construct a list of   84VLinux联盟
    the NIS servers. Please continue to add the names for YP servers in order   84VLinux联盟
    of preference, one per line. When you are done with the list, type   84VLinux联盟
    a <control D>; or a return on a line by itself.   84VLinux联盟
next host to add: SUN-2   84VLinux联盟
next host to add: SUN-1  (如果 不配置slave server 可以不写) 84VLinux联盟
next host to add:^D   84VLinux联盟
The current list of yp servers looks like this:   84VLinux联盟
server1   84VLinux联盟
Is this correct? [y/n: y] y   84VLinux联盟
Installing the YP database will require that you answer a few questions.   84VLinux联盟
Questions will all be asked at the beginning of the procedure.   84VLinux联盟
Do you want this procedure to quit on non-fatal errors? [y/n: n] n   84VLinux联盟
OK, please remember to go back and redo manually whatever fails. If you   84VLinux联盟
don't, some part of the system (perhaps the yp itself) won't work.   84VLinux联盟
84VLinux联盟
#/usr/lib/netsvc/yp/ypstart  84VLinux联盟
84VLinux联盟
# ypwhich –m           :如果能看到Master server的信息说明configure 成功 84VLinux联盟
84VLinux联盟
84VLinux联盟
NIS Client --------solaris  84VLinux联盟
1、#cp /etc/nsswitch.nis /etc/nsswitch.conf   84VLinux联盟
2、#vi /etc/hosts   84VLinux联盟
10.1.100.2SUN-2 loghost   84VLinux联盟
   10.1.100.1 SUN-1   84VLinux联盟
3、#domainname  testdomain 84VLinux联盟
4、#domainname >; /etc/defaultdomain   84VLinux联盟
5、#ypinit –c   84VLinux联盟
  (when prompted for a list of NIS servers,enter the names of the NIS master   84VLinux联盟
  and all slave servers)   84VLinux联盟
6、#/usr/lib/netsvc/yp/ypstart   84VLinux联盟
84VLinux联盟
# ypwhich –m           :如果能看到Master server的信息说明configure 成功 84VLinux联盟
84VLinux联盟
84VLinux联盟
84VLinux联盟
84VLinux联盟
 NIS slave server --------solaris  84VLinux联盟
1、#cp /etc/nsswitch.nis /etc/nsswitch.conf   84VLinux联盟
2、edit the /etc/hosts file to ensure that the NIS master and all   84VLinux联盟
  NIS slave servers have been defined   84VLinux联盟
3、#domainname  testdomain 84VLinux联盟
4、#domainname >; /etc/defaultdomain   84VLinux联盟
5、#ypinit -c   84VLinux联盟
(when prompted for a list of NIS servers,enter the names of the NIS master   84VLinux联盟
and all slave servers)   84VLinux联盟
(on the NIS master,ensure the ypserv process is running ,we can use   84VLinux联盟
#ps –ef|grep ypserv)   84VLinux联盟
6、#/usr/lib/netsvc/yp/ypstart   84VLinux联盟
7、#ypinit –s   84VLinux联盟
(if you did not add the name of the NIS slave server when you initially   84VLinux联盟
configured the NIS master server,you should run #ypinit –m once more on   84VLinux联盟
the NIS master server) 84VLinux联盟
NIS client--------linux 84VLinux联盟
84VLinux联盟
84VLinux联盟
先看 ypbind是否起来,否则用 rpm 安裝。省略.. 84VLinux联盟
ntsysv﹐确定 ypbind 选择 84VLinux联盟
84VLinux联盟
84VLinux联盟
1/bin/nisdomainname testdomain 84VLinux联盟
84VLinux联盟
84VLinux联盟
2然后修改 /etc/yp.conf﹐加入 84VLinux联盟
84VLinux联盟
domain testdomain 84VLinux联盟
ypserver SUN-2 或主机的ip 84VLinux联盟
84VLinux联盟
84VLinux联盟
84VLinux联盟
3修改 /etc/sysconfig/network 84VLinux联盟
加入 84VLinux联盟
NISDOMAIN=testdomain 84VLinux联盟
84VLinux联盟
4修改 /etc/nsswitch﹐修改 84VLinux联盟
passwd: files nis nisplus 84VLinux联盟
shadow: files nis nisplus 84VLinux联盟
group:  files nis nisplus 84VLinux联盟
84VLinux联盟
修改 /etc/passwd﹐在末尾加入﹕ 84VLinux联盟
84VLinux联盟
+:::::: # 就是 + 号和6个冒号,(看文档说的 ,不知道原因,请高手指点) 84VLinux联盟
84VLinux联盟
然后启动ypbind﹕ 84VLinux联盟
service ypbind restart 84VLinux联盟
应该就OK了  84VLinux联盟
AUTOFS—solaris 84VLinux联盟
首先 建立好你要mount的目录 84VLinux联盟
这里主要是对Makefile文件的修改 ./var/yp下的 84VLinux联盟
1,vi /var/yp/Makefile(粗体是你要添加的) 84VLinux联盟
all: passwd group hosts ipnodes ethers networks rpc services protocols \ 84VLinux联盟
netgroup bootparams aliases publickey netid netmasks c2secure \ 84VLinux联盟
timezone auto.master auto.home auto.test\ 84VLinux联盟
2 84VLinux联盟
... 84VLinux联盟
auto.master: auto.master.time 84VLinux联盟
auto.home: auto.home.time 84VLinux联盟
auto.test: auto.test.time 84VLinux联盟
auth.attr:auth.attr.time 84VLinux联盟
exec.attr:exec.attr.time 84VLinux联盟
prof.attr:prof.attr.time 84VLinux联盟
user.attr:user.attr.time 84VLinux联盟
audit.user:audit.user.time 84VLinux联盟
$(DIR)/netid: 84VLinux联盟
$(DIR)/timezone: 84VLinux联盟
$(DIR)/auto_master: 84VLinux联盟
$(DIR)/auto_home: 84VLinux联盟
$(DIR)/auto_test: 84VLinux联盟
$(PWDIR)/shadow: 84VLinux联盟
3这个文件要自己添加的,注意 空格,和TAB 是区分的,不然,等会Make你就死的狠难看啊..(当时 痛苦死…) 84VLinux联盟
84VLinux联盟
auto.direct.time: $(DIR)/auto_direct 84VLinux联盟
-@if [ -f $(DIR)/auto_direct ]; then \ 84VLinux联盟
sed -e "/^#/d" -e s/#.*$$// $(DIR)/auto_direct \ 84VLinux联盟
| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.direct; \ 84VLinux联盟
touch auto.direct.time; \ 84VLinux联盟
echo "updated auto.direct"; \ 84VLinux联盟
if [ ! $(NOPUSH) ]; then \ 84VLinux联盟
4 84VLinux联盟
然后,执行 84VLinux联盟
/usr/ccs/bin/make 84VLinux联盟
Atuofs----Linux  84VLinux联盟
确定autofs服务的running.然后运行 ntsysv 选择 autofs 84VLinux联盟
84VLinux联盟
修改/etc/auto.master ﹐加入如下句子﹕ 84VLinux联盟
84VLinux联盟
       /home    /etc/auto.home        --timeout=60 84VLinux联盟
84VLinux联盟
84VLinux联盟
然后 vi /etc/auto.home 84VLinux联盟
*     test:/export/home/& 84VLinux联盟
84VLinux联盟
mkdir /home/yphome 84VLinux联盟
84VLinux联盟
84VLinux联盟
最后执行 autofs 和 ypbind 服务﹕ 84VLinux联盟
servcie autofs restart 84VLinux联盟
service ypbind restart 84VLinux联盟
84VLinux联盟
84VLinux联盟
84VLinux联盟
注意:  1有时候出现make正常但,autofs不上,我的原因是 域名的原因,请注意,有域名和管理域名的区别吧.. 84VLinux联盟
  2,可能出现什么 RPC错误的用rpcinfo命令查看,我没遇到,所以不说了 84VLinux联盟
84VLinux联盟
关于Linux的NFS与Solaris不同点:  84VLinux联盟
84VLinux联盟
1. Solaris的目录共享设置文件是/etc/dfs/dfstab, 而RadHat Linux共享目录设置文件是/etc/exports  84VLinux联盟
2. Solaris开机自动mount设置文件是/etc/vfstab, 而RadHat Linux开机自动mount设置文件是/etc/fstab 84VLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
无相关信息