添加linux client 到 NIS DOMAIN

原文地址:http://www.chinaunix.net/old_jh/6/93271.html

[size=18]1)LOGIN NIS MASTER SERVER  登陆到SOLARIS NIS 主机 [/size]

System time Mon Jun 16 16:00:27 CST 2003
System info: SunOS star 5.8 Generic_108528-05 sun4u sparc SUNW,Ultra-5_10
Log-on info: richard @ star
richard@<star: 1>; su 

成为超级用户 ROOT

>;domainname 
yourdomain.com 

root@<star: 3>; vi /etc/hosts 
编辑 NIS MASTER 的 HOST TABLE
 
192.168.1.201   star            Primary NIS
192.168.1.200   moon            Secondary NIS
X.X.X.X  
192.168.1.216   mavericks       Blade1000
192.168.1.217   spurs           sf280r
192.168.1.218   nets            sf280r
192.168.1.199   solaris86       solarisx86
192.168.1.198    rh01           redhat linux

加入Linux 的IP 地址 和主机名。(LOGIN LINUX BOX) 

1.1) Red Hat Linux Advanced Server release 2.1AS/i686 (Pensacola)
login: eda
Password:
Last login: Mon Jun 16 16:41:17 on :0
[root@rh01 eda]# tcsh
[eda@rh01 eda]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:05:5D:62:12:E4
          inet addr:192.168.1.198  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10162 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6237 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:12735963 (12.1 Mb)  TX bytes:413551 (403.8 Kb)
          Interrupt:11 Base address:0xc400
          
 
2)Login Linux BOX 登陆到LINUX 主机

Red Hat Linux Advanced Server release 2.1AS/i686 (Pensacola)
login: eda
Password:
Last login: Mon Jun 16 16:41:17 on :0
[eda@rh01 eda]$ su
Password:

2.1)编辑 linux HOSTS table  vi /etc/hosts
# Valid entries are
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       rh01    localhost.localdomain   localhost

192.168.1.198   rh01

192.168.1.201  star   nis matser  --把NIS MASTER 和SALVE 都加进来。
192.168.1.200  moon   nis salve

2.2)编辑 /etc/yp.conf 
vi /etc/yp.conf


# /etc/yp.conf - ypbind configuration file
# Valid entries are
#
#domain NISDOMAIN server HOSTNAME
#       Use server HOSTNAME for the domain NISDOMAIN.
#
#domain NISDOMAIN broadcast
#       Use  broadcast  on  the local net for domain NISDOMAIN
#
#ypserver HOSTNAME
#       Use server HOSTNAME for the  local  domain.  The
#       IP-address of server must be listed in /etc/hosts.
#
ypserver   192.168.1.201  ----- 加入 YP MATER 的 IP 


2.3)编辑/etc/nsswitch.conf

[root@rh01 etc]# vi  /etc/nsswitch.conf

[root@rh01 etc]# more /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#       nisplus or nis+         Use NIS+ (NIS version 3)
(这里去掉#)       nis or yp               Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:      nis  files
shadow:      nis  files 
group:       nis  files

#hosts:     db files nisplus nis dns
hosts:       nis  files


2.4) 加入DOMAIN NAME 
 /bin/domainname   yourdomain.com
 
2.5) 启动PORTMAP  
cd /etc/rc.d/init.d/
[root@rh01 init.d]# ./portmap status
portmap (pid 610) is running...

2.6) 启动YPBIND 。。。。
[root@rh01 init.d]# ./ypbind start
Binding to the NIS domain:                                 [  OK  ]
Listening for an NIS domain server.
[root@rh01 init.d]#
2.7) 测试YP SERVER 
[root@rh01 init.d]# ypwhich
star

[root@rh01 etc]# ping spurs
PING spurs (192.168.1.217) from 192.168.1.198 : 56(84) bytes of data.
64 bytes from spurs (192.168.1.217): icmp_seq=0 ttl=255 time=814 usec
64 bytes from spurs (192.168.1.217): icmp_seq=1 ttl=255 time=147 usec

ypcat hosts 
[root@rh01 etc]# ypcat hosts
192.168.1.198   rh01 redhat linux
192.168.1.201   star Primary NIS
192.168.1.216   mavericks Blade1000
192.168.1.199   solaris86 solarisx86
192.168.1.216   mavericks Blade1000
127.0.0.1       localhost
192.168.1.217   spurs sf280r
192.168.1.212   hawks Sf280r
192.168.1.200   moon Secondary NIS

3)登陆SOLARIS YP MASTER  

3.1) System time Mon Jun 16 17:31:59 CST 2003
System info: SunOS star 5.8 Generic_108528-05 sun4u sparc SUNW,Ultra-5_10
Log-on info: richard @ star
richard@<star: 1>; ping rh01
rh01 is alive
richard@<star: 2>; rsh rh01
Password: 
Last login: Mon Jun 16 18:14:18 from nets
No directory /export/home2/richard!
Logging in with home = "/".
root: Command not found.
root: Undefined variable.
[richard@rh01 /]$ pwd
/
[richard@rh01 /]$ ls
bin   dev  home    lib         misc  opt   root  tmp  var
boot  etc  initrd  lost+found  mnt   proc  sbin  usr
[richard@rh01 /]$ 

到这里LINUX YP client 就算成了。。

3.2)但是SOLARIS 上的用户 RLOGING 到LINUX 上会说 NO HOME DIRECOTORY 

所以要把 SOLARIS 上的 HOME DIRECOTRY MOUNT 到 LINUX 上来。
LOGIN LINUX 

mount -t nfs moon:/export/home2 /export/home2/ 

在LINUX 上 MOUNT 好SOLARIS HOME 之后在 RLOGIN 
richard@<star: 3>; rsh rh01
Password: 
Last login: Mon Jun 16 18:29:02 from star
[richard@rh01 ~]$ pwd
/export/home2/richard

就OK了。。。
不过最好都做成AUTOFS 和 AUTO HOME

AUTOFS 和 AUTO HOME 下次再写。。

MMMMN:我的东西写完了。8-(
  
BSD client 有点难。。加密不样。。。RLOGIN 不进。。

下次 补上。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值