免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: komi
打印 上一主题 下一主题

在AS4下安装过OSCAR的朋友请进 [复制链接]

论坛徽章:
0
21 [报告]
发表于 2006-05-11 12:07 |只看该作者
还是关于nis的yptest的问题
Test 3: yp_match
WARNING: No such map in server's domain (Map passwd.byname, key nobody)

This test checks for an entry for the user "nobody" in your passwd map.
If your network isn't expected to have one in NIS (i.e., if "nobody" is
a local user whose information is stored in /etc/passwd and
/etc/shadow), then it's not an error.
从这段回复来看 这个应该是不影响yp的使用的吧

[ 本帖最后由 komi 于 2006-5-11 12:18 编辑 ]

论坛徽章:
0
22 [报告]
发表于 2006-05-12 16:09 |只看该作者
前面的问题都克服了 只剩下最后的这个checking for NFS propagation of MPI preferences 了
nntp老师 /home 挂载果然是要把主节点的/home 挂载出去 还是rw的权限 真够寒的
奇怪的是这次测试居然没有ganglia setup 了  这个checking for NFS propagation of MPI preferences  丝毫头绪都没有 看不大明白它到底是提示我哪里错了

1.png (23.55 KB, 下载次数: 16)

1.png

论坛徽章:
0
23 [报告]
发表于 2006-05-12 17:40 |只看该作者
nis 好像不正确.

论坛徽章:
0
24 [报告]
发表于 2006-05-15 12:22 |只看该作者
nntp老师 我在 所有的机器上打 yptest -u oscartst 命令 显示的结果是all test passed 这个应该就不是nis设置错误的问题了吧 都两天了 又丝毫没有进展 泪流满面ing  是不是要挂载某个东东出来?

论坛徽章:
0
25 [报告]
发表于 2006-05-17 16:09 |只看该作者
nntp老师 这几天我潜心研究nis 可是还是研究不出个所以然来 我的nis的设置是按照
NIS Server 設定流程
 
開始設定吧!在我的系統當中,假定我的網路狀況如下:
 
網域為 192.168.10.0/24
NIS Server 的 IP 為 192.168.10.30,對應的主機名稱為 server.cluster
NIS 的領域名稱設定為 cluster
 
在 NIS Server 端以 root 身份登入後,進行下面的工作:
 
啟動 portmap 並設定開機時啟動:
這個應該不難吧!使用: [root@test root]# /etc/rc.d/init.d/portmap start
[root@test root]# netstat -tl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:sunrpc                *:*                     LISTEN
# 如果看到 sunrpc 的話,就表示啟動成功了!
[root@test root]# chkconfig --level 35 portmap on
# 上面這一行在設定 portmap 在 run-level 為 3, 5 的時候就開機時啟動!
很簡單吧!這樣 portmap 就啟動了!
 
啟動 time 與 time-udp :
由於 time 與 time-upd 是在 NIS 運作時所需要的 daemon ,所以也必須要啟動他啦!啟動的方式也很簡單,就是利用 xinet 這個 super daemon 來進行即可! [root@test root]# vi /etc/xinetd.d/time
# 找到底下這一行:
disable = yes
# 將他改成  
disable = no
# 儲存後離開
[root@test root]# vi /etc/xinetd.d/time-udp
# 同樣的將 disable = yes 改成 disable = no 即可!
 
[root@test root]# /etc/rc.d/init.d/xinetd restart
[root@test root]# netstat -utl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:time                  *:*                     LISTEN
tcp        0      0 *:sunrpc                *:*                     LISTEN
udp        0      0 *:time                  *:*
udp        0      0 *:sunrpc                *:*
注意喔!目前至少也要有上面四個 LISTEN 的 port 才行喔!分別是 UDP 與 TCP 封包的啦!
 
建立 NIS 的領域名稱 ( nisdomainname )
在 NIS 的系統當中,他的領域名稱 (domain name) 是與 DNS 沒有絕對關係的,由於這個領域名稱會常被使用到,因此我們需要將他建立起來!建立起來的方法很簡單,直接執行一個指令,並修改一個檔案即可! 1. 建立 NIS 的領域名稱 (我這裡是設定為 cluster ):
[root@test root]# nisdomainname cluster
[root@test root]# vi /etc/rc.d/rc.local
# 將底下這一行加入這個檔案的最後一行內:
/bin/nisdomainname cluster
 
2. 設定好網路參數:
[root@test root]# vi /etc/sysconfig/network
# 加入底下這一行:
NISDOMAIN=cluster
 
設定 ypserv 的設定檔: ypserv.conf
這個設定檔的內容其實也是很簡單,大概只有幾行而已,設定的主要語法為: <設定項目>:<設定項目的值>
我們先談一談他裡面的幾個設定細項: [root@test root]# vi /etc/ypserv.conf
files: 30
# 這說的是『有多少資料庫檔案(database file)會被先讀進快取記憶體當中』
# 的意思,一般來說, 30 是已經很足夠的數值了,不需要更動他;
 
trusted_master: your.master.servers.name
xfr_check_port: yes
# 上面這兩個都僅與 Master + Slave 架構有關的設定值,一般來說,
# 只有一部主要 NIS Server 的系統中是用不到這兩個設定值的!
# 如果你的 NIS 是 slave 的架構,那麼需要指定一部 master 做為資料庫內容的
# 同步時候的主機,那就是 trusted_master 的設定內容囉!
# 如果沒有 master/slave 架構時,那就不需要 trusted_master 這個設定了!
# 至於 xfr_check_port 則是指定 master 與 slave 是否都要以 < 1024  
# 以下的 port 來進行溝通的訊息!通常預設就是 yes ,不需要更動他!
 
# <主機名稱/IP>:<網域名稱>:<資料庫類別>:<安全性>
# 這個是這個檔案裡面最重要的部分了!主要在設定安全性的方面,
# 可以設定多行,而是否能夠通過的規則是『一行一行檢查』的方式!
# 所以這裡的設定應該是:先開放要開放的網域,然後全部都關閉!
# 先談一談各個相關的項目:
# 1. 主機名稱/IP:這裡可以這樣設定:192.168.1.0/255.255.255.0
# 2. 網域名稱:通常都設定成為 * 即可!
# 3. 資料庫類別:可以使用 * 來表示所有的資料庫!
# 4. 安全性:主要有三種參數:
#      none :無論如何就是可以無條件進入本機;
#      port :僅允許 < 1024 以下的 port 進入;
#      deny :無論如何就是關閉不讓人家登入主機!
# 由於我是允許 127.0.0.0/255.0.0.0 以及 192.168.10.0/255.255.255.0 進入,
# 其他的都關閉!所以我可以這樣設定:
127.0.0.0/255.255.255.0   :  *  :  *  :  none
192.168.10.0/255.255.255.0:  *  :  *  :  none
*                         :  *  :  *  :  deny
# 但是因為 /etc/shadow 裡面的檔案總不好讓人看到吧!而又由於 Linux  
# 系統當中,只有 root 可以啟用 < 1024 以下的 port ,因此,更安全的設定,
可以這樣做:
127.0.0.0/255.255.255.0   :  *  :  *  :  port
192.168.10.0/255.255.255.0:  *  :  *  :  port
*                         :  *  :  *  :  deny
# 三行也就夠了!
# 無論如何,如果您想要讓您的 NIS Server 運作的較為快速,並且安全性上面
# 沒有太多的考量(內部網域時!),那麼使用 none 是一個不錯的主意!
 
建立網路信任群組:
這個 /etc/netgroup 檔案可以記錄在我們網域裡面被信任的群,這個檔案的內容當中,每一行都有三個欄位,分別以逗號『,』隔開,意義為: <host>,<user>,<domain>
主機,使用者帳號,領域名稱
事實上,如果這個檔案是『空的』的話,那麼代表著『全部的主機、帳號與領域名稱都接受』的意思,因為我們已經在 /etc/ypserv.conf 裡頭設定好了關於安全的項目了,所以這個檔案只要建立即可(本來是不存在的!): [root@test root]# touch /etc/netgroup
 
啟動 ypserv 這個 daemon ,並且設定開機時啟動:
好了!都設定完成之後,在接下來自然就是要啟動了!啟動有兩個 daemons ,啟動的方式為: 1. 啟動囉!
[root@test root]# /etc/rc.d/init.d/ypserv    start
[root@test root]# /etc/rc.d/init.d/yppasswdd start
 
2. 觀察一下是否真的有動作?
[root@test root]# rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
[root @test root]# rpcinfo -u localhost yppasswdd
program 100009 version 1 ready and waiting
# 這個 rpcinfo 就是在觀察與 RPC Server 有關的 program 目前的狀況!
# 因此可以用他來觀察你的 ypserv 喔!
 
3. 設定開機時啟動:
# 你可以使用 ntsysv ,這裡我們使用 chkconfig 囉!
[root@test root]# chkconfig --level 35 ypserv on
[root@test root]# chkconfig --level 35 yppasswdd on
 
製作資料庫、並重新啟動 ypserv 與 yppasswd :
好了,既然 NIS Server 主要是要提供資料庫給大家參考用的,所以當然要製作資料庫囉!然後,我們又將這些資料庫讀入快取當中,所以資料庫製作完畢之後,一定要重新啟動 ypserv 與 yppasswdd 才行! 1. 製作資料庫:
[root@test root]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers.  server.cluster is in the list of NIS server hosts.  Please continue to add
the names for the other hosts, one per line.  When you are done with the
list, type a <control D>.
        next host to add:  server.cluster
        next host to add: <==在這裡按下[ctrl + d]跳出
The current list of NIS servers looks like this:
server.cluster

Is this correct?  [y/n: y]  y
We need a few minutes to build the databases...
Building /var/yp/cluster/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/cluster'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating mail.aliases...
gmake[1]: Leaving directory `/var/yp/cluster'
server.cluster has been set up as a NIS master server.
Now you can run ypinit -s server.cluster on all slave server.

# 這個動作是每次修改使用者資料後一定要做的動作!,就是重新製作資料庫,
# 然後並且需要重新啟動 ypserv 與 yppasswdd 喔!
 
2. 重新啟動服務:
[root@test root]# /etc/rc.d/init.d/ypserv    restart
[root@test root]# /etc/rc.d/init.d/yppasswdd restart

這個動作的重點是在 /var/yp 這個目錄當中,製作了多個的等待 NIS Clients 查尋的資料庫!請注意的是,每次在 NIS server 上面更動使用者的資料時,一定需要重新做這個步驟喔!
 
這樣 Server 的部分就設定妥當了!如果您還想要玩一玩 master 與 slave 的架構的話,那就請參考:
NIS HOW-TO:http://www.linux-nis.org/nis-howto/HOWTO/index.html

--------------------------------------------------------------------------------
Client 端設定
設定完了 Sever 之後, NIS Client 也需要設定喔!( 註:在 NIS clients 主機記錄的登入者的資訊中,僅記錄 UID 大於 500 以上的使用者喔!因為小於 500 以下的 UID 都是預設給系統使用的,因此是預設不開放給 NIS 來查尋,自然也就不會被寫入 NIS 資料庫檔案當中了! )
 

--------------------------------------------------------------------------------
NIS Client 的結構
 
還記得上面提過的,NIS Client 需要的套件是:
 
ypbind
yp-tools
 
至少也要這兩個套件才可以喔!至於相關的設定檔為:
 
/etc/yp.conf :設定 NIS Server 的主機名稱與領域名稱
/etc/hosts :至少需要設定 NIS server 主機 IP 對應的主機名稱喔!
/etc/passwd :指定需要查尋的是什麼;
/etc/nsswitch.conf :指定要使用什麼 daemon 查尋帳號與密碼。
 
大致上就是如此啦!我們要設定的資訊也就是如同上面的檔案囉!好!設定吧!
 

--------------------------------------------------------------------------------
NIS Client 的設定流程
 
請留意的是,底下的設定都是在 Client 端喔!不要在主機端作這些設定了!^_^
 
啟動 portmap 並設定開機時啟動:
不論是 RPC Server 還是 RPC Client ,反正只要是 RPC 的相關服務要應用,就一定要有 portmap 的輔助才行!所以,啟動並設定開機時啟動吧! [root@client root]# /etc/rc.d/init.d/portmap start
[root@client root]# netstat -tl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:sunrpc                *:*                     LISTEN
如果看到 sunrpc 的話,就表示啟動成功了!
[root@test root]# chkconfig --level 35 portmap on
上面這一行在設定 portmap 在 run-level 為 3, 5 的時候就開機時啟動!
很簡單吧!這樣 portmap 就啟動了!
 
設定 NIS Server 的 IP 對應主機名稱:
請看上面 Server 設定之前的假設,我的 NIS Server 的 IP 與主機名稱記錄在 Client 端的 /etc/hosts 上面: [root@client root]# vi /etc/hosts
# 要有底下這一行喔!
192.168.10.30 server.cluster
 
設定 NIS 的 domain 與 NIS 的主機:
NIS Server 與 Client 的 NIS domain 一定要相同,所以我們必須要花一點時間來將這個咚咚搞定: 1. 建立 NIS domain name:
[root@client root]# nisdomainname cluster
[root@client root]# vi /etc/rc.d/rc.local
# 加入底下這一行:
/bin/nisdomainname cluster
[root@client root]# vi /etc/sysconfig/network
# 加入底下這一行:
NISDOMAIN=cluster
 
2. 建立 NIS 查尋的主機名稱
[root@client root]# vi /etc/yp.conf
# 加入這兩行:
domain cluster
ypserver server.cluster
# 還是要記得,那個 cluster 是你的 NIS 的 domain ,至於 server.cluster  
# 則是 NIS Server 的主機名稱,我這裡是使用內部私有 IP ,所以名稱可以隨便
# 我喜歡來選擇的喔!
 
修改密碼驗證的方式:
密碼驗證的方式是一定要修改的,不然你的系統怎麼知道要去哪裡使用什麼方式查尋帳號、密碼資料呢?!所以您至少需要更改兩個檔案喔! 1. 密碼檔的修改:
[root@client root]# vi /etc/passwd
# 還記得這個檔案嗎?這個檔案總共有七個欄位,而每個欄位都以分號『:』隔開,
# 相關的資訊請參考基礎學習篇裡面的帳號管理章節。由於我們要將資料
# 設定以 NIS Server 的資料庫來驗證,因此,
# 在這個檔案的最後面加入這一行:
+::::::
# 注意喔!在 + 之後連續加六個『 : 』,並且中間沒有空白字元!
 
2. 查尋密碼的程序:
# 因為我們有很多方式來查尋密碼,需要修改 /etc/nsswitch.conf 這個檔案才行
[root@client root]# vi /etc/nsswitch.conf
# 找到相關的參數,並改成底下這樣:
passwd:     files nis nisplus
shadow:     files nis nisplus
group:      files nis nisplus
hosts:      files nis dns
# 這個檔案在設定一些資訊的查尋程序!那個 files 指的是本機的相關檔案,
# 至於 nis 則是透過 NIS 來進行查尋,至於 nisplus 則是 NIS+ 這是比較新
# 版的 NIS 啦!不過,官方網站上面說,目前這個發展的計畫已經暫停了!
# 1. passwd: 就是使用者相關資訊查尋,分別為 /etc/passwd, nis 與 nisplus
# 2. shadow: 就是使用者密碼的查尋, /etc/shadow, nis 及 nisplus
# 3. group:  就是使用者的群組資訊查尋, /etc/group, nis 及 nisplus
# 4. hosts:  就是主機名稱與IP對應的查尋,/etc/hosts, nis 及 /etc/resolv.conf
 
啟動 ypbind 與設定開機啟動:
這樣幾乎就設定完成了!而我們前面說過, NIS Client 也需要啟動 ypbind 這個 daemon 的,所以就給他啟動吧! 1. 直接手動啟動 ypbind 吧:
[root@client root]# /etc/rc.d/init.d/ypbind start
[root@client root]# rpcinfo -p localhost
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100007    2   udp    735  ypbind
    100007    1   udp    735  ypbind
    100007    2   tcp    738  ypbind
    100007    1   tcp    738  ypbind
# 至少要有上面幾個資訊才是對的喔!不過,需要記得的是,那個 port number
# 是系統隨機啟動的,所以 port number 每次都會不太一樣啊!
# 記得要經常用 rpcinfo 去檢查一下 RPC Server 相關的服務才行!
 
2. 設定開機時啟動:
[root@client root]# chkconfig --level 35 ypbind on
 
基本上,上面的動作就已經設定好了一部 NIS Client 主機了!而且已經可以跑囉!不過,我們畢竟不知道到底目前我們的 NIS Client 主機使用的 NIS Server 主機裡面的哪些資料,並且如何去確認我們的資料庫與設定值都沒有問題呢?!呵呵!所以底下我們就來談一談那個 yp-tools 提供的相關好用的工具程式來檢驗囉
这个来设定完成的不知道哪里不正确 请nntp老师指正下 学生感激不尽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP