現象:
Linux機器上不能使用普通使用者登入,登入時等待時間很長,不能登入,
手動掛載NIS服務端的/home目錄時,出現如下錯誤:
do_ypcall: clnt_call: RPC: Unable to send; errno = Network is unreachable do_ypcall
檢查發現該台機器是NIS客戶機器。
解決:
啟動NIS伺服器的相關服務。
/etc/init.d/portmap start
/etc/init.d/ypserv start
/etc/init.d/yppasswdd start
啟動NIS用戶端的相關服務。
/etc/init.d/ypbind start
發現啟動Failed!
檢查NIS伺服器的設定檔 /etc/ypserv.conf
# The following, when uncommented, will give you shadow like passwords.
# Note that it will not work if you have slave NIS servers in your
# network that do not run the same server as you.
# Host : Domain : Map : Security
#
# * : * : passwd.byname : port
# * : * : passwd.byuid : port
127.0.0.0/255.0.0.0 : * : * : none
10.10.104.0/255.255.255.0 : * : * : none
192.168.0.0/255.255.255.0 : * : * : none
* : * : * : deny
然後查看客戶機器的IP地址,發現不在以下網段內:
10.10.104.0/255.255.255.0
192.168.0.0/255.255.255.0
檢查發現客戶機器網卡eth1沒啟動,該網卡的IP地址在網段 192.168.0.0/255.255.255.0 內。
於是啟動網卡eth1,然後再啟動用戶端的NIS相關服務。
[root@gd87 ~]# /etc/init.d/ypbind start
Binding to the NIS domain:
Listening for an NIS domain server.
然後客戶機器便可以使用普通使用者登入。