The Linux NIS(YP)/NYS/NIS+ HOWTO

Thorsten Kukuk

拞栰晲梇 - (擔杮岅栿)

v1.3j1 2003-10-19 (尨暥 1 July 2003)

  偙偺暥彂偱偼 Linux 傪 NIS(YP) 傑偨偼 NIS+ 偺僋儔僀傾儞僩偵愝掕偡傞曽
朄丄偍傛傃 NIS 僒乕僶傪僀儞僗僩乕儖偡傞曽朄偵偮偄偰弎傋傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

Table of Contents
1. 偼偠傔偵
   
    1.1. 偙偺暥彂偺嵟怴斉
    1.2. 柶愑
    1.3. 僼傿乕僪僶僢僋偲崱屻偺夵斉
    1.4. 幱帿
   
2. 梡岅廤偲堦斒揑側忣曬
   
    2.1. 梡岅廤  
    2.2. 堦斒揑側忣曬  
   
3. NIS 偐 NYS 偐 NIS+ 偐
   
    3.1. libc 4/5 偱偼 trad-NIS 偐丄偦傟偲傕 NYS 儔僀僽儔儕偐丠  
    3.2. glibc 2 偲 NIS/NIS+  
    3.3. NIS 偐 NIS+ 偐丠 
   
4. 摦嶌尨棟
   
    4.1. NIS 偺摦嶌尨棟 
    4.2. NIS+ 偺摦嶌尨棟 
   
5. RPC 億乕僩儅僢僷  
6. NIS 偺愝掕 
   
    6.1. 儅僗僞乕僒乕僶丄僗儗乕僽僒乕僶丄僋儔僀傾儞僩傪寛傔傞 
    6.2. 僜僼僩僂僃傾 
   
7. NIS 僋儔僀傾儞僩偺愝掕
   
    7.1. ypbind 僨乕儌儞  
    7.2. trad-NIS 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 
    7.3. NYS 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 
    7.4. glibc 2.x 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 
    7.5. nsswitch.conf 僼傽僀儖  
    7.6. Shadow 僷僗儚乕僪偲 NIS 
   
8. NIS+ 偺愝掕
   
    8.1. 僜僼僩僂僃傾 
    8.2. NIS+ 僋儔僀傾儞僩偺僙僢僩傾僢僾 
    8.3. NIS+ 偲 keylogin, login, PAM 
    8.4. nsswitch.conf 僼傽僀儖  
   
9. NIS 僒乕僶偺愝掕 
   
    9.1. 僒乕僶僾儘僌儔儉 ypserv  
    9.2. 僒乕僶僾儘僌儔儉 yps  
    9.3. rpc.ypxfrd 僾儘僌儔儉  
    9.4. rpc.yppasswdd 僾儘僌儔儉  
   
10. NIS/NYS 僀儞僗僩乕儖偺僠僃僢僋  
11. NIS 儅僢僾偺惗惉偲峏怴 
   
    11.1. NIS 儅僢僾偺惗惉 
    11.2. NIS 儅僢僾傪峏怴偡傞 
    11.3. 儅僢僾偺僄儞僩儕偺挿偝 
   
12. 嵞婲摦帪偺帺摦幚峴
   
    12.1. NIS 梡偺婲摦僗僋儕僾僩
    12.2. NIS 僪儊僀儞柤
    12.3. 僨傿僗僩儕價儏乕僔儑儞屌桳偺榖戣
   
13. rpasswd 偱僷僗儚乕僪傪曄峏偡傞 
   
    13.1. 僒乕僶偺愝掕 
    13.2. 僋儔僀傾儞僩偺愝掕 
   
14. NIS 偱傛偔偍偙傞栤戣偲偦偺夝寛曽朄  
15. 傛偔偁傞幙栤 (FAQ) 

1. 偼偠傔偵

Linux 儅僔儞偼偳傫偳傫僱僢僩儚乕僋偵愙懕偝傟傞傛偆偵側偭偰偒傑偟偨丅傑
偨僱僢僩儚乕僋娗棟偺娙棯壔偺偨傔偵丄傎偲傫偳偺僱僢僩儚乕僋 (摿偵 Sun 偑
儀乕僗偵側偭偰偄傞僱僢僩儚乕僋) 偱偼 NIS 偑摦偄偰偄傑偡丅 Linux 儅僔儞
偱偼丄偙傟傜偺 NIS 僒乕價僗傪梋偡偲偙傠側偔庴偗偨傝丄傑偨採嫙偟偨傝偡傞
偙偲偑偱偒傑偡丅傑偨 Linux 儅僔儞偼丄姰慡偵婡擻偡傞 NIS+ 僋儔僀傾儞僩偲
偟偰摦嶌偝偣傞偙偲傕偱偒傑偡丅偨偩偟偙偪傜偼傑偩儀乕僞偺抜奒偱偡丅

偙偺暥彂偼 Linux 儅僔儞偵 NIS(YP) 偲 NIS+ 傪僙僢僩傾僢僾偡傞曽朄偵偮偄
偰婰弎偟偨傕偺偱偡丅偄偢傟傪嵦梡偡傞偵偟偰傕 Section 5 偼昁偢撉傫偱壓偝
偄丅

NIS-HOWTO 偼 Thorsten Kukuk <kukuk@suse.de> 偵傛偭偰曇廤丒娗棟偝傟偰偄
傑偡丅

埲慜偺 NIS-HOWTO 偼丄埲壓偺恖乆偵傛偭偰幏昅偝傟傑偟偨丅斵傜偵姶幱偟傑偡
丅

Andrea Dell'Amico <adellam@ZIA.ms.it>      
Mitchum DSouza    <Mitch.DSouza@NetComm.IE>
Erwin Embsen      <erwin@nioz.nl>          
Peter Eriksson    <peter@ifm.liu.se>       

栿拲丗 v0.2 偺擔杮岅栿偼崻娸椙惇偝傫偵傛偭偰岞奐偝傟傑偟偨丅 0.6 傊偺捛
悘偲埲崀偺娗棟偼拞栰晲梇偑峴偭偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.1. 偙偺暥彂偺嵟怴斉

偙偺暥彂偺嵟怴斉偼偄偮偱傕 WWW 偱墈棗偡傞偙偲偑偱偒傑偡丅 URL 偼 http:/
/www.linux-nis.org/nis-howto/HOWTO/NIS-HOWTO.html 偱偡丅

偙偺僪僉儏儊儞僩偺嵟怴斉偼丄 Linux 娭楢偺 WWW 僒僀僩傗 FTP 僒僀僩偵傕搊
榐偝傟傑偡丅傕偪傠傫 LDP 偺儂乕儉儁乕僕偵傕偁傝傑偡丅

東栿暥彂傊偺儕儞僋偼 http://www.linux-nis.org/nis-howto/ 偵傑偲傔偰偁傝
傑偡丅

栿拲丗擔杮岅斉偺暥彂偺嵟怴斉偼 JF Project 偺儁乕僕 <http://
www.linux.or.jp/JF/JFdocs/NIS-HOWTO/> 偵抲偐傟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.2. 柶愑

偙偺暥復偼巹偺抦幆傪嵟戝尷廤傔偰彂偄偨偮傕傝偱偡偑丄惓妋偱側偄晹暘傕偁
傞偐傕偟傟傑偣傫丅偙偺暥彂偱徯夘偟偰偄傞僾儘僌儔儉偵偮偄偰偼丄偦傟偧傟
偵晅懏偟偰偄傞 README 僼傽僀儖傪昁偢撉傫偱壓偝偄丅偦傟傜偵偼傛傝徻偟偄
愢柧傗傛傝惓妋側忣曬偑彂偐傟偰偄傞偼偢偱偡偺偱丅傕偪傠傫偙偺僪僉儏儊儞
僩傕偱偒傞偩偗娫堘偄偺側偄傕偺偵偟偰偄偒偨偄偲峫偊偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.3. 僼傿乕僪僶僢僋偲崱屻偺夵斉

偙偺暥彂偵娭偡傞幙栤傗僐儊儞僩偑偁傝傑偟偨傜丄偍婥寉偵 Thorsten Kukuk
傑偱儊乕儖傪壓偝偄丅傾僪儗僗偼 kukuk@linux-nis.org <mailto:
kukuk@linux-nis.org> 偱偡丅採埬傗斸敾傕娊寎偟傑偡丅偙偺暥彂偵岆傝傪尒偮
偗偨傜丄巹偵楢棈偟偰壓偝傟偽師偺斉偱掶惓偟傑偡丅傛傠偟偔偍婅偄偟傑偡丅

栿拲丗東栿偵懳偡傞僐儊儞僩偼拞栰晲梇 <nakano@apm.seikei.ac.jp> 傑偱偍婅
偄偟傑偡丅

側偍丄偁側偨偺 Linux 攝晍僷僢働乕僕偵摿桳偺栤戣偵娭偟偰偼巹偵儊乕儖傪憲
傜側偄偱壓偝偄両巹偼偡傋偰偺攝晍僷僢働乕僕傪抦偭偰偄傞栿偱偼偁傝傑偣傫
丅偨偩丄傕偟夝寛朄傕憲偭偰偄偨偩偗傟偽丄暥彂偵捛壛偟偨偄偲偼巚偭偰偄傑
偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.4. 幱帿

偙偺僪僉儏儊儞僩傪嶌惉偡傞偵偁偨偭偰丄捈愙揑偁傞偄偼娫愙揑偵偍悽榖偵側
傝傑偟偨埲壓偺曽乆偵姶幱偟傑偡丅傾儖僼傽儀僢僩弴偵丗

Byron A Jeff           <byron@cc.gatech.edu>
Markus Rex             <msrex@suse.de>      
Miquel van Smoorenburg <miquels@cistron.nl> 
Dan York               <dyork@lodestar2.com>
Christoffer Bromberg   <christoffer@web.de> 

yp-clients 偺僆儕僕僫儖僐乕僪偼 Theo de Raadt 偵傛偭偰嶌惉偝傟傑偟偨丅
Swen Thuemmler 偑 yp-clients 偺僐乕僪傪 Linux 偵堏怉偟丄 yp 娭楢偺儖乕
僠儞 (偙傟傕 Theo 偺巇帠) 傪 libc 偵堏怉偟傑偟偨丅 Thorsten Kukuk 偼
GNU libc 2.x 岦偗偺 NIS(YP) 偲 NIS+ 偺儖乕僠儞傪僗僋儔僢僠偐傜彂偒傑偟
偨丅

栿拲丗擔杮岅栿偵偁偨偭偰偼丄徻嵶側峑惓傪偟偰壓偝偭偨徏杮彲巌偝傫丄晲堜
怢岝偝傫丄偐偹偙偝傫傪偼偠傔丄 JF 儊乕儕儞僌儕僗僩偺奆偝傫偵偍悽榖偵側
傝傑偟偨丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2. 梡岅廤偲堦斒揑側忣曬

2.1. 梡岅廤  

偙偺僪僉儏儊儞僩拞偱偼懡偔偺徣棯岅偑巊傢傟偰偄傑偡丅埲壓偵廳梫側傕偺偺
愢柧傪娙扨偵嫇偘偰偍偒傑偡丅

DBM
   
    僨乕僞儀乕僗儅僱僕儊儞僩 (DataBase Management)丅専嶕僉乕偲僨乕僞偲
    偺儁傾傪娗棟偡傞僨乕僞儀乕僗婡擻傪帩偭偨儔僀僽儔儕偺偙偲丅
   
DLL
   
    摦揑儕儞僋儔僀僽儕 (Dynamically Linked Library)丅僾儘僌儔儉偺幚峴帪
    偵儕儞僋偝傟傞儔僀僽儔儕偺偙偲丅
   
domainname
   
    NIS 僒乕僶偑敪峴偡傞僉乕儚乕僪丅 NIS 僋儔僀傾儞僩懁偑巊梡偡傞 NIS
    僒乕僶傪摿掕偡傞偺偵梡偄傜傟傞丅偙偺 domainname 偼 DNS 偺 "domain"
    偲摨偠傕偺偵偡傞昁梫偼側偔丄傓偟傠暿偵偡傋偒偱偁傞丅
   
FTP
   
    僼傽僀儖揮憲僾儘僩僐儖 (File Transfer Protocol)丅僐儞僺儏乕僞娫偱僼
    傽僀儖傪揮憲偡傞帪偵梡偄傜傟傞僾儘僩僐儖偺堦偮丅
   
libnsl
   
    僱乕儉僒乕價僗儔僀僽儔儕 (Name services library)丅 SVR4 Unix 偵偍偗
    傞僱乕儉僒乕價僗娭楢偺柦椷 (getpwnam, getservbyname 側偳) 偺儔僀僽
    儔儕丅 GNU libc 偱偼 NIS (YP) 偍傛傃 NIS+ 婡擻偵偙偺儔僀僽儔儕傪梡
    偄傞丅
   
libsocket
   
    SVR4 Unix 偱丄僜働僢僩娭學偺僔僗僥儉僐乕儖 (socket, bind, listen 側
    偳) 傪採嫙偡傞儔僀僽儔儕丅
   
NIS
   
    僱僢僩儚乕僋忣曬僒乕價僗 (Network Information Service)丅僱僢僩儚乕
    僋忋偺偡傋偰偺寁嶼婡偱昁梫側忣曬傪嫟桳偡傞僒乕價僗偺偙偲丅 Linux 偺
    昗弨 libc 儔僀僽儔儕偵偼 NIS 偺僒億乕僩偑娷傑傟偰偍傝丄偙傟傪偙偺暥
    彂偱偼 "trad-NIS" 偲婰偡丅
   
    (栿拲丗尨暥偱偼 "traditional NIS" 偱偟偨偑丄挿偄偺偱栿幰偑彑庤偵憿
    岅偟傑偟偨)
   
NIS+
   
    Network Information Service (Plus)丅婎杮揑偵偼 NIS 傪婡擻傾僢僾偟偨
    傕偺丅 NIS+ 偼 Sun Microsystems Inc. 偵傛偭偰愝寁偝傟丄 NIS 傪屻宲
    偡傞傕偺偲偝傟偰偄傞丅僙僉儏儕僥傿偑嫮壔偝傟丄戝偒側僔僗僥儉偵摫擖
    偡傞偺偑梕堈偵側偭偰偄傞丅
   
NYS
   
    NYS 偼乽NIS+, YP, Switch乿傪昞偡僾儘僕僃僋僩柤偱偁傞丅 Peter
    Eriksson <pen@signum.se> 偑娗棟偟偰偄傞丅偙偺僾儘僕僃僋僩偱偼 NIS(=
    YP) 偺僐乕僪傪 0 偐傜嵞幚憰偟偰偍傝丄 NYS 儔僀僽儔儕偺僱乕儉僒乕價
    僗僗僀僢僠婡擻傪棙梡偡傞傛偆偵側偭偰偄傞丅
   
NSS
   
    僱乕儉僒乕價僗僗僀僢僠 (Name Service Switch)丅 /etc/nsswitch.conf
    僼傽僀儖偵傛偭偰丄奺庬偺忣曬偺儕僋僄僗僩偵懳偟偰偳傫側弴斣偱専嶕傪
    峴偆偐傪寛掕偡傞丅
   
RPC
   
    儕儌乕僩僾儘僔僕儍乕僐乕儖 (Remote Procedure Call)丅 C 僾儘僌儔儉撪
    偱 RPC 儖乕僠儞傪棙梡偡傟偽丄僱僢僩儚乕僋忋偵偁傞懠偺寁嶼婡忋偺庤懕
    偒 (僒僽儖乕僠儞) 傪屇傃偩偡偙偲偑偱偒傞丅捠忢偺暥柆偵偍偄偰偼 Sun
    偺 RPC 幚憰偺堄枴偱梡偄傜傟傞偙偲偑懡偄丅
   
YP
   
    僀僄儘乕儁乕僕 (Yellow Pages (TM)) Yellow Pages 偼塸崙 British
    Telecom 幮偺搊榐彜昗丅
   
TCP-IP
   
    Transmission Control Protocol/Internet Protocol 偺棯丅 TCP/IP 偼
    Unix 偱旕忢偵傛偔巊傢傟偰偄傞僨乕僞捠怣僾儘僩僐儖偱偁傞丅
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.2. 堦斒揑側忣曬  

埲壓偺撪梕偼 Sun(tm) System & Network Administration Manual 偐傜偺堷梡
偱偡丅

    NIS 偼偐偮偰僒儞丒僀僄儘乕儁乕僕 (Sun Yellow Pages, YP) 偲屇偽傟偰
    偄傑偟偨丅偟偐偟乽Yellow Pages乿偼塸崙 British Telecom 幮偺搊榐彜昗
    偱丄嫋壜柍偔巊梡偡傞偙偲偑偱偒傑偣傫偺偱丄NIS 偲屇傇偙偲偵偟傑偟偨
    丅
   
NIS 偼 Network Information Service 偺棯偱偡丅僱僢僩儚乕僋忋偺偡傋偰偺寁
嶼婡偱嫟桳偡傋偒忣曬傪採嫙偡傞偨傔偵梡偄傜傟傑偡丅 NIS 偱採嫙偝傟傞忣曬
偲偼丄椺偊偽埲壓偺傛偆側傕偺偱偡丅

 丒 儘僌僀儞柤丄僷僗儚乕僪丄儂乕儉僨傿儗僋僩儕 (/etc/passwd)
   
 丒 僌儖乕僾忣曬 (/etc/group)
   
 

椺偊偽丄偁側偨偺僷僗儚乕僪偑 NIS 偺僷僗儚乕僪僨乕僞儀乕僗偵搊榐偝傟偰偄
傞偲偟傑偟傚偆丅偡傞偲偁側偨偼丄偦偙偱 NIS 偺僋儔僀傾儞僩僾儘僌儔儉偑摦
偄偰偄傟偽丄僱僢僩儚乕僋忋偺偳偺寁嶼婡偵傕儘僌僀儞偡傞偙偲偑偱偒傞傛偆
偵側傞偺偱偡丅

Sun 偼 Sun Microsystems 幮偺彜昗偱偁傝丄 SunSoft 幮偵儔僀僙儞僗嫙梌偝傟
偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3. NIS 偐 NYS 偐 NIS+ 偐

3.1. libc 4/5 偱偼 trad-NIS 偐丄偦傟偲傕 NYS 儔僀僽儔儕偐丠  

trad-NIS 傪梡偄傞偐 NYS 儔僀僽儔儕偺 NIS 僐乕僪傪梡偄傞偐偼丄乽掅婡擻偩
偑埨掕乿傪偲傞偐乽廮擃偩偑朻尟乿傪偲傞偐偺慖戰偲尵偊傑偡丅

trad-NIS 偺僐乕僪偼昗弨 C 儔僀僽儔儕偵擖偭偰偐傜偩偄傇宱偭偰偄傑偡丅惗
傑傟偑屆偄暘丄傗傗廮擃惈偵寚偗傞偲偙傠偑偁傝傑偡丅

堦曽 NYS 儔僀僽儔儕偺 NIS 僐乕僪傪梡偄傞偵偼丄 libc 儔僀僽儔儕傪嵞僐儞
僷僀儖偟偰 libnsl 偺僐乕僪傪 libc 偺拞偵娷傔傞昁梫偑偁傝傑偡 (偦偺傛偆
偵僐儞僷僀儖偝傟偨 libc 儔僀僽儔儕傪擖庤偱偒傞偐傕偟傟傑偣傫)丅

傕偆堦偮偺憡堘揰偲偟偰丄 trad-NIS 偺僐乕僪偱偼 NIS 偺僱僢僩僌儖乕僾婡擻
偑巊偊傑偡偑丄 NYS 偺僐乕僪偵偼幚憰偝傟偰偄傑偣傫丅媡偵 NYS 偺僐乕僪偱
偼 Shadow Password 傪摟夁揑偵埖偆偙偲偑偱偒傞傛偆偵側偭偰偄傑偡偑丄
trad-NIS 偺僐乕僪偼 NIS 宱桼偺 Shadow 僷僗儚乕僪傪僒億乕僩偟偰偄傑偣傫
丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.2. glibc 2 偲 NIS/NIS+  

GNU C Library 2.x (libc6) 傪巊偭偰偄傞応崌偼丄埲忋偺慡偰偼朰傟偰壓偝偄
丅 libc6 偱偼 NSS (僱乕儉僗僀僢僠僒乕價僗) 傪姰慡偵僒億乕僩偟偰偍傝丄旕
忢偵廮擃側塣梡偑偱偒傞傛偆偵側偭偰偄傑偡丅傑偨埲壓偺 NIS乛NIS+ 儅僢僾偑
僒億乕僩偝傟偰偄傑偡: aliases, ethers, group, hosts, netgroups,
networks, protocols, publickey, passwd, rpc, services, shadow. GNU C
Library 偱偼丄 shadow 僷僗儚乕僪傪 NIS 偱傑偭偨偔栤戣側偔埖偆偙偲偑偱偒
傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.3. NIS 偐 NIS+ 偐丠 

NIS 偲 NIS+ 偺慖戰偼娙扨偱偡丅摿偵僙僉儏儕僥傿偵夁晀偵側傞昁梫偑側偗傟
偽丄NIS 傪巊偄傑偟傚偆丅 NIS+ 偺娗棟偼偢偭偲戝曄偱偡 (僋儔僀傾儞僩懁偱
偼偦傟傎偳偱傕偁傝傑偣傫偑丄僒乕僶乕娗棟偼抧崠偱偡)丅偦傟偵 Linux 忋偱
偺 NIS+ 偵偼懡偔偺僶僌偑偁傝傑偡偟丄奐敪偼巭傑偭偰偟傑偭偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4. 摦嶌尨棟

4.1. NIS 偺摦嶌尨棟 

彮側偔偲傕 1 戜偺 NIS 偺僒乕僶乕偑僱僢僩儚乕僋忋偵昁梫偱偡丅暋悢偺僒乕
僶傪壱摦偝偣傞偙偲傕偱偒傑偡丅偙偺応崌偼偦傟偧傟傪堎側偭偨 NIS 乽僪儊僀
儞乿偺僒乕僶偲偡傞偐丄偁傞偄偼 2 戜偺僒乕僶傪傂偲偮偺僪儊僀儞忋偱嫤挷偟
偰摦嶌偝偣傞偙偲偵側傝傑偡丅屻幰偺峔惉偱偼 1 戜偺僒乕僶偑乽儅僗僞乕僒乕
僶乿偲側傝丄偦偺懠偺僒乕僶偼慡偰乽僗儗乕僽僒乕僶乿偲屇偽傟傑偡 (偙傟偼
1 偮偺乽僪儊僀儞乿傪梡偄偨応崌偺峔惉偱偡)丅偙偺椉曽傪梡偄丄僪儊僀儞傪暋
悢丄偦傟偧傟偵懳偡傞僒乕僶傕暋悢丄偲偄偭偨峔惉傕壜擻偱偡丅

僗儗乕僽僒乕僶偼丄儅僗僞乕僒乕僶偺 NIS 僨乕僞儀乕僗偺僐僺乕傪帩偮偩偗偱
丄儅僗僞乕僒乕僶偺 NIS 僨乕僞儀乕僗偑曄峏偝傟傞偲丄拃堦偦傟傪庴偗庢傝傑
偡丅僱僢僩儚乕僋偵愙懕偝傟偰偄傞寁嶼婡偺戜悢偲僱僢僩儚乕僋偺怣棅惈傪峫
椂偟丄僗儗乕僽僒乕僶傪僀儞僗僩乕儖偡傞偐偳偆偐 (僀儞僗僩乕儖偡傞応崌偼
偦偺戜悢) 傪寛傔偰壓偝偄丅 NIS 僋儔僀傾儞僩偼丄NIS 僒乕僶偑乽棊偪偰乿偄
偨傝丄儗僗億儞僗偑抶偐偭偨傝偡傞応崌偵偼丄棊偪偰偄側偄僒乕僶傗傕偭偲儗
僗億儞僗偺懍偄僒乕僶偲偺愙懕傪帋傒傑偡丅

NIS 僨乕僞儀乕僗偼 ASCII 宍幃偺僨乕僞儀乕僗偐傜曄姺偝傟偨丄偄傢備傞 DBM
僼僅乕儅僢僩偵側偭偰偄傑偡丅椺偊偽 /etc/passwd 傗 /etc/group 偲偄偭偨僼
傽僀儖偼丄 ASCII-DBM 曄姺僾儘僌儔儉 (僒乕僶僜僼僩僂僃傾偵娷傑傟偰偄傞 
makedbm) 傪梡偄偰捈愙 DBM僼僅乕儅僢僩偵曄姺偱偒傑偡丅NIS 偺儅僗僞乕僒乕
僶偼丄 ASCII 宍幃偲 DBM 宍幃偺僨乕僞儀乕僗偲偺椉曽傪帩偭偰偄側偔偰偼側
傝傑偣傫丅

僗儗乕僽僒乕僶偼 NIS 儅僢僾偑曄峏偝傟傞偲捠抦傪庴偗傑偡 (yppush 僾儘僌
儔儉偑梡偄傜傟傑偡)丅偡傞偲僗儗乕僽僒乕僶偼昁梫側曄峏傪帺摦揑偵峴偄丄僨
乕僞儀乕僗傪摨婜偝偣傑偡丅 NIS 僋儔僀傾儞僩偵偙偺傛偆側嶌嬈傪偡傞昁梫偼
偁傝傑偣傫丅僋儔僀傾儞僩偼忢偵嵟怴偺 DBM 僨乕僞儀乕僗偺撪梕傪 NIS 僒乕
僶偵撉傒偵峴偔偐傜偱偡丅

ypbind 偺屆偄僶乕僕儑儞偱偼丄摦嶌拞偺 NIS 僒乕僶傪扵偡偺偵僽儘乕僪僉儍
僗僩傪梡偄偰偄傑偟偨丅偙傟偵偼僙僉儏儕僥傿忋偺栤戣偑偁傝傑偟偨丅側偤側
傜扤偐偑 NIS 僒乕僶傪僀儞僗僩乕儖偟偰丄僽儘乕僪僉儍僗僩偺栤偄崌傢偣偵摎
偊傞傛偆偵偱偒傞偐傜偱偡丅怴偟偄僶乕僕儑儞偺 ypbind (ypbind-3.3 傑偨偼
ypbind-mt) 偱偼丄僒乕僶傪愝掕僼傽僀儖偐傜庢摼偱偒傑偡 - 偟偨偑偭偰僽儘
乕僪僉儍僗僩偼晄梫偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.2. NIS+ 偺摦嶌尨棟 

NIS+ 偼 Sun 偵傛傞怴偟偄僱僢僩儚乕僋僀儞僼僅儊乕僔儑儞僒乕價僗偱偡丅
NIS 偲 NIS+ 偺嵟傕戝偒側堘偄偼丄NIS+ 偱偼僨乕僞偺埫崋壔偲 secure RPC 傪
捠偟偨擣徹偲偑壜擻偵側偭偰偄傞揰偱偡丅

NIS+ 偺柦柤儌僨儖偼僣儕乕峔憿偵婎偯偄偰偄傑偡丅僣儕乕偺偦傟偧傟偺僲乕僪
偑 NIS+ 偺僆僽僕僃僋僩偵懳墳偟偰偍傝丄偙傟偵偼榋偮偺僞僀僾偑偁傝傑偡丅
僨傿儗僋僩儕 (directory), 僄儞僩儕 (entry), 僌儖乕僾 (group), 儕儞僋
(link), 僥乕僽儖 (table), 僾儔僀儀乕僩 (private) 偱偡丅

NIS+ 偺柤慜嬻娫偱儖乕僩偲側傞 NIS+ 僨傿儗僋僩儕偼 root 僨傿儗僋僩儕偲屇
偽傟傑偡丅 NIS+ 偵偼擇偮偺摿暿側僨傿儗僋僩儕偑懚嵼偟傑偡丅 org_dir 偲
groups_dir 偱偡丅 org_dir 僨傿儗僋僩儕偵偼偡傋偰偺娗棟僥乕僽儖偑娷傑傟
傑偡丅椺偊偽 passwd, hosts, mail_aliases 側偳偱偡丅 groups_dir 僨傿儗僋
僩儕偵偼傾僋僙僗僐儞僩儘乕儖偵梡偄傜傟傞 NIS+ 僌儖乕僾僆僽僕僃僋僩偑娷
傑傟傑偡丅 org_dir 偲 groups_dir 偍傛傃偦傟傜偺恊僨傿儗僋僩儕傪廤傔偨傕
偺偑 NIS+ 僪儊僀儞偲偟偰嶲徠偝傟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5. RPC 億乕僩儅僢僷  

偙傟偐傜愢柧偟偰偄偔僜僼僩僂僃傾傪摦偐偡偨傔偵偼丄傑偢 /sbin/portmap 傪
摦嶌偝偣偰偍偔昁梫偑偁傝傑偡丅 Linux 偺攝晍僷僢働乕僕偺拞偵偼丄偙偺僨乕
儌儞傪棫偪忋偘傞偨傔偺僐儅儞僪偑 /sbin/init.d/ 傗 /etc/rc.d/ 偵彂偒崬傫
偱偁傞傕偺傕偁傝傑偡偺偱丄偦偺応崌偼奩摉晹暘傪桳岠偵側傞傛偆偵偟偰儕僽
乕僩偡傞偩偗偱偡丅幚嵺偺傗傝曽偼僨傿僗僩儕價儏乕僔儑儞偺僪僉儏儊儞僩傪
撉傒傑偟傚偆丅

RPC 億乕僩儅僢僷 (portmap(8)) 偼丄 RPC 僾儘僌儔儉斣崋傪 TCP/IP 億乕僩斣
崋偵曄姺偡傞僒乕僶僾儘僌儔儉偱偡丅 RPC 僒乕僶 (NIS/NIS+ 僒乕僶側偳) 偵
RPC 屇傃偩偟傪峴偆 (NIS/NIS+ 僋儔僀傾儞僩偼偙傟傪峴偭偰偄傑偡) 偨傔偵偼
丄偦偺儅僔儞偱 RPC 億乕僩儅僢僷偑摦偄偰偄傞昁梫偑偁傝傑偡丅 RPC 僒乕僶
僾儘僌儔儉偼丄娔帇偡傞 TCP/IP 億乕僩斣崋偲僨乕僞傪採嫙偡傞 RPC 僾儘僌儔
儉斣崋傪丄婲摦帪偵億乕僩儅僢僷偵揱偊傑偡丅僋儔僀傾儞僩僾儘僌儔儉偑丄偁
傞 RPC 僾儘僌儔儉斣崋偵僐乕儖傪峴偆嵺偵偼丄傑偢僒乕僶儅僔儞忋偺 RPC 億
乕僩儅僢僷偲岎怣偟偰丄偳偺 TCP/IP 億乕僩斣崋偵 RPC 偺僷働僢僩傪憲傟偽椙
偄偺偐傪寛掕偟傑偡丅

RPC 僒乕僶僾儘僌儔儉偼 inetd(8) 偐傜傕婲摦偱偒傑偡偐傜丄 RPC 億乕僩儅僢
僷偼 inetd 傛傝慜偵婲摦偡傞傛偆偵偟偰偔偩偝偄丅

secure RPC 傪梡偄傞応崌偵偼丄億乕僩儅僢僷偼 time 僒乕價僗傪昁梫偲偟傑偡
丅偡傋偰偺儂僗僩偺 /etc/inetd.conf 偱丄埲壓偺傛偆偵 time 僒乕價僗偑棙梡
壜擻偵側偭偰偄傞偙偲傪妋擣偟偰壓偝偄丅

#                                                                      
# Time service is used for clock syncronization.                       
#                                                                      
time    stream  tcp     nowait  root    internal                       
time    dgram   udp     wait    root    internal                       

廳梫丗愝掕僼傽僀儖曄峏偟偨偁偲 inetd 傪嵞婲摦偡傞偺傪朰傟側偄偙偲!

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6. NIS 偺愝掕 

6.1. 儅僗僞乕僒乕僶丄僗儗乕僽僒乕僶丄僋儔僀傾儞僩傪寛傔傞 

傑偢埲壓偺擇偮偺応崌傪峫偊傞昁梫偑偁傝傑偡丅

 

 1. 愙懕偡傞僱僢僩儚乕僋忋偵 NIS 僒乕僶偑偁傞応崌丅
   
 2. 愙懕偡傞僱僢僩儚乕僋忋偵 NIS 僒乕僶偑側偄応崌丅
   
 

嵟弶偺働乕僗偱偼 ypbind, ypwhich, ypcat, yppoll, ypmatch 偲偄偭偨僋儔僀
傾儞僩僾儘僌儔儉傪婲摦偡傞偩偗偱巊偊傞傛偆偵側傝傑偡丅堦斣廳梫側偺偼 
ypbind 偱丄偙偺僾儘僌儔儉偼忢偵幚峴偝傟偰偄傞昁梫偑偁傝傑偡 (偮傑傝 ps
僐儅儞僪傪幚峴偟偨偲偒偵僾儘僙僗僥乕僽儖偵昞帵偝傟側偗傟偽側傝傑偣傫)丅
ypbind 偼偄傢備傞僨乕儌儞僾儘僙僗偱丄僔僗僥儉偺僗僞乕僩傾僢僾僼傽僀儖偐
傜婲摦偡傞昁梫偑偁傝傑偡 (偮傑傝 /etc/init.d/nis, /sbin/init.d/
ypclient, /etc/rc.d/init.d/ypbind, /etc/rc.local 側偳)丅 ypbind 偑婲摦
偝傟傟偽丄偦偺寁嶼婡偼偦偺帪揰偐傜 NIS 僋儔僀傾儞僩偲側傝傑偡丅

擇斣栚偺働乕僗丄偮傑傝 NIS 僒乕僶偑側偄応崌偵偼丄 NIS 僒乕僶僾儘僌儔儉
(捠忢偼 ypserv) 傕昁梫偲側傝傑偡丅偙偺暥彂偺 Section 9 偱偼丄偙偺 
ypserv 僨乕儌儞傪梡偄偰 Linux 儅僔儞傪 NIS 僒乕僶偵愝掕偡傞曽朄偵偮偄偰
愢柧偟偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.2. 僜僼僩僂僃傾 

僶乕僕儑儞 4.4.2 埲崀偺僔僗僥儉儔僀僽儔儕 /usr/lib/libc.a 傕偟偔偼嫟桳
儔僀僽儔儕 /lib/libc.so.x 偵偼丄 NIS 偺僋儔僀傾儞僩丒僒乕僶僾儘僌儔儉偺
僐儞僷僀儖偵昁梫側僔僗僥儉僐乕儖偑偡傋偰娷傑傟偰偄傑偡丅 GNU C Library
2 (glibc 2.x) 偱偼 /lib/libnsl.so.1 傕昁梫偱偡丅

NIS 偼 /usr/lib/libc.a 偺僶乕僕儑儞 4.5.21 埲忋偱偟偐摦偐側偄偲偄偆曬崘
偑偁傝傑偡偺偱丄埨慡偺偨傔偵偼屆偄傕偺偼巊傢側偄曽偑椙偄偱偟傚偆丅 NIS
偺僋儔僀傾儞僩僾儘僌儔儉偼埲壓偱擖庤偱偒傑偡丅

Site and Directory                            Filename                 
ftp.kernel.org:/pub/linux/utils/net/NIS <ftp: yp-tools-2.8.tar.gz      
//ftp.kernel.org/pub/linux/utils/net/NIS/>    ypbind-mt-1.13.tar.gz    
                                              ypbind-3.3.tar.gz        
                                              ypbind-3.3-glibc5.diff.gz

僜僼僩傪庤偵擖傟偨傜丄摨崼偝傟偰偄傞愢柧偵偟偨偑偭偰壓偝偄丅 yp-clients
2.2 偼 libc4 傑偨偼 5.4.20 傑偱偺 libc5 偲嫟偵梡偄偰壓偝偄丅 libc
5.4.21 埲崀偲 glibc 2.x 偵偼 yp-tools 1.4.1 埲崀偑昁梫偱偡丅怴偟偄
yp-tools 偺僶乕僕儑儞 2.4 偼丄偡傋偰偺 Linux libc 偱摦嶌偟傑偡丅 5.4.21
偐傜 5.4.35 傑偱偺 libc 偼丄 NIS 偺僐乕僪偵僶僌偑偁傞偺偱巊傢側偄曽偑椙
偄偱偟傚偆丅 libc 5.4.36 埲崀傪巊傢側偄偲丄傎偲傫偳偺 YP 僾儘僌儔儉偼摦
嶌偟側偄偱偟傚偆丅 ypbind 3.3 傕偡傋偰偺儔僀僽儔儕偱摦嶌偟傑偡丅 gcc
2.8.x 埲崀偐 egcs丄 glibc 2.x 傪棙梡偟偰偄傞応崌偼丄
ypbind-3.3-glibc5.diff 僷僢僠傪 ypbind 3.3 偵摉偰傞昁梫偑偁傝傑偡丅僙僉
儏儕僥傿偵栤戣偑偁傞偺偱丄壜擻側傜 ypbind 3.3 偼巊傢側偄傎偆偑椙偄偱偟
傚偆丅 ypbind-mt 偼丄怴偟偔奐敪偝傟偨儅儖僠僗儗僢僪偺僨乕儌儞偱偡丅偙傟
偵偼 Linux 2.2 僇乕僱儖偲 glibc 2.1 埲崀偑昁梫偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7. NIS 僋儔僀傾儞僩偺愝掕

7.1. ypbind 僨乕儌儞  

僜僼僩僂僃傾偑偆傑偔僐儞僷僀儖偱偒偨傜僀儞僗僩乕儖偟傑偟傚偆丅 ypbind
僨乕儌儞偼 /usr/sbin 僨傿儗僋僩儕偵擖傟傞偲椙偄偱偟傚偆丅 NYS 偺僔僗僥
儉偱偼 ypbind 偼昁梫側偄偲尵偆恖偑偄傞傛偆偱偡偑丄偙傟偼娫堘偭偰偄傑偡
丅 ypwhich 偲 ypcat 偼丄偐側傜偢 ypbind 傪昁梫偲偟傑偡丅

ypbind 偺僀儞僗僩乕儖偼傕偪傠傫僗乕僷乕儐乕僓偱峴偆昁梫偑偁傝傑偡丅懠偺
僶僀僫儕 (ypwhich, ypcat, yppoll, ypmatch) 偼偡傋偰偺儐乕僓乕偐傜傾僋僙
僗壜擻側僨傿儗僋僩儕偵抲偒傑偟傚偆丅捠忢偼 /usr/bin 偑椙偄偱偟傚偆丅

嵟嬤偺 ypbind 偵偼愝掕僼傽僀儖 /etc/yp.conf 偑偁傝傑偡丅偙偙偵 NIS 僒乕
僶傪捈偵彂偄偰偍偔偙偲傕偱偒傑偡丅徻偟偔偼 ypbind(8) 偺儅僯儏傾儖傪撉傫
偱壓偝偄丅偙偺僼傽僀儖偼 NYS 偱傕昁梫偱偡丅埲壓偼椺偱偡丅

ypserver 10.10.0.1                                                     
ypserver 10.0.100.8                                                    
ypserver 10.3.1.1                                                      

NIS 側偟偱傕儂僗僩柤偺夝寛偑偱偒傞僔僗僥儉偱偼丄 IP 傾僪儗僗偱側偔柤慜
傪梡偄傞偙偲偑偱偒傑偡丅偦偆偱側偗傟偽 IP 傾僪儗僗傪梡偄傑偡丅 ypbind
3.3 偵偼僶僌偑偁傝丄嵟屻偺僄儞僩儕 (忋婰偺椺偱偼 ypserver 10.3.1.1) 偟
偐梡偄傜傟偢丄懠偼慡偰柍帇偝傟傑偡丅 ypbind-mt 偱偼惓偟偔埖偆偙偲偑偱偒
丄嵟弶偵曉帠偟偨僒乕僶偑梡偄傜傟傑偡丅

ypbind 傪僗僞乕僩傾僢僾僼傽僀儖偵擖傟傞慜偵僥僗僩偟偰偍偔偙偲傪偍姪傔偟
傑偡丅 ypbind 偺僥僗僩偼埲壓偺傛偆偵偟偰峴偄傑偡丅

 

 丒 YP 偺僪儊僀儞僱乕儉偑愝掕偝傟偰偄傞偙偲傪妋擣偟偰壓偝偄丅愝掕偝傟偰
    偄側偄応崌偼埲壓偺傛偆偵偟傑偡丅
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆/bin/domainname nis.domain                              劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    nis.domain 偼捠忢揔摉側暥帤楍偱丄偁側偨偺儅僔儞偺 DNS 僪儊僀儞僱乕
    儉偲偼堘偆傕偺偵偡傋偒偱偡丅偙偆偟偰偍偗偽丄奜晹偺僋儔僢僇乕偑僒乕
    僶偐傜 NIS 僷僗儚乕僪僨乕僞儀乕僗傪搻傫偱偄偔偺偑傢偢偐側偑傜崲擄偵
    側傝傑偡丅 NIS 僪儊僀儞柤傪抦傜側偄応崌偼僔僗僥儉娗棟幰偐僱僢僩儚乕
    僋娗棟幰偵恞偹偰壓偝偄丅 
   
 丒 /sbin/portmap 偑婲摦偝傟偰偄側偗傟偽婲摦偟傑偡丅 
   
 丒 /var/yp 偲偄偆僨傿儗僋僩儕偑側偗傟偽嶌惉偟傑偡丅 
   
 丒 /usr/sbin/ypbind 傪婲摦偟傑偡丅 
   
 丒 ypbind 偑僒乕價僗撪梕傪億乕僩儅僢僷偵搊榐偱偒偨偐偳偆偐妋偐傔傞偨傔
    偵丄 rpcinfo -p localhost 偲偄偆僐儅儞僪傪幚峴偟偰壓偝偄丅埲壓偺傛
    偆側弌椡偑尰傢傟傞偼偢偱偡丅
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆program vers proto   port                               劆
    劆 100000    2   tcp    111  portmapper                   劆
    劆 100000    2   udp    111  portmapper                   劆
    劆 100007    2   udp    637  ypbind                       劆
    劆 100007    2   tcp    639  ypbind                       劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    偁傞偄偼巊偭偰偄傞僶乕僕儑儞偵傛偭偰偼
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆program vers proto   port                               劆
    劆 100000    2   tcp    111  portmapper                   劆
    劆 100000    2   udp    111  portmapper                   劆
    劆 100007    2   udp    758  ypbind                       劆
    劆 100007    1   udp    758  ypbind                       劆
    劆 100007    2   tcp    761  ypbind                       劆
    劆 100007    1   tcp    761  ypbind                       劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    偺傛偆偵側傞偐傕偟傟傑偣傫丅
   
 丒 rpcinfo -u localhost ypbind 傕幚峴偟偰傒偰壓偝偄丅埲壓偺傛偆側昞帵
    偑弌傞偼偢偱偡丅
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆program 100007 version 2 ready and waiting              劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    偁傞偄偼僀儞僗僩乕儖偟偨 ypbind 偺僶乕僕儑儞偵傛偭偰偼
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆program 100007 version 1 ready and waiting              劆
    劆program 100007 version 2 ready and waiting              劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    偺傛偆側弌椡偵側傞偐傕偟傟傑偣傫丅廳梫側偺偼 "version 2" 偺儊僢僙乕
    僕偩偗偱偡丅
   
 

偙偙傑偱棃傟偽 ypcat 偺傛偆側 NIS 僋儔僀傾儞僩僾儘僌儔儉傪幚峴偱偒傞偼
偢偱偡丅椺偊偽 NIS 偺僷僗儚乕僪僨乕僞儀乕僗傪嶲徠偟偨偄応崌偵偼丄 ypcat
passwd.byname 偲偟傑偡丅

廳梫: 傕偟忋弎偺 ypbind 偺僥僗僩傪徣棯偟偨応崌丄彮側偔偲傕僪儊僀儞僱乕
儉偑愝掕偟偰偁傞偙偲偲 /var/yp 偲偄偆柤慜偺僨傿儗僋僩儕偑嶌偭偰偁傞偙偲
傪妋擣偟偰壓偝偄丅 /var/yp 偑側偄偲 ypbind 偼惓忢偵婲摦偱偒傑偣傫丅

僪儊僀儞僱乕儉偺愝掕偑惓偟偄偐偳偆偐傪僠僃僢僋偡傞偵偼丄 yp-tools 2.2
偺 /bin/ypdomainname 傪巊偭偰壓偝偄丅偙偺僾儘僌儔儉偼
yp_get_default_domain() 娭悢傪巊偆偺偱丄傛傝尩偟偄僠僃僢僋偑偱偒傑偡丅
椺偊偽 Linux 偱僨僼僅儖僩偵側偭偰偄傞 (偦偟偰懡偔偺栤戣偺尨場偵側偭偰偄
傞) "(none)" 偺傛偆側僪儊僀儞柤偼丄偙偺僾儘僌儔儉偱偼嫋壜偝傟傑偣傫丅

僥僗僩偑偆傑偔偄偭偨傜僗僞乕僩傾僢僾僼傽僀儖傪曄峏偟偰丄僽乕僩帪偵 
ypbind 偑婲摦偝傟傞傛偆偵偟偰偍偔偲椙偄偱偟傚偆丅帺摦揑偵 NIS 僋儔僀傾
儞僩偲偟偰偺妶摦偑奐巒偝傟傑偡丅 ypbind 偺婲摦慜偵丄僪儊僀儞僱乕儉偑愝
掕偝傟傞傛偆偵偡傞偺傕朰傟側偄偙偲丅

埲忋偱愝掕偼廔椆偟傑偟偨丅儕僽乕僩偟偰丄僽乕僩儊僢僙乕僕偱 ypbind 偑惓
忢偵摦嶌偟偰偄傞偐偳偆偐妋擣偟偰壓偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.2. trad-NIS 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 

儂僗僩偺柤慜夝寛偵 NIS 傪梡偄傞偵偼丄 /etc/host.conf 僼傽僀儖偱夝寛弴傪
巜掕偡傞峴偵 "nis" 傪巜掕 (傑偨偼捛壛) 偟偰壓偝偄丅徻嵶偵晅偄偰偼
resolv+(8) 偺儅僯儏傾儖傪撉傫偱壓偝偄丅

埲壓偺峴傪 NIS 僋儔僀傾儞僩偺 /etc/passwd 偵捛壛偟偰壓偝偄丅

 

+::::::                                                                

 

+ 傗 - 偲偄偭偨暥帤傪巊偊偽丄儐乕僓乕傪捛壛/嶍彍偟偨傝忬懺傪曄峏偟偨傝
偱偒傑偡丅椺偊偽儐乕僓 guest 傪嶍彍偟偨偄側傜 /etc/passwd 僼傽僀儖偵
-guest 傪捛壛偡傟偽 OK 偱偡丅儐乕僓 "linux" 偵堘偭偨僔僃儖 (椺偊偽 ksh)
傪巊傢偣偨偄偱偡偭偰丠戝忎晇丄"+linux::::::/bin/ksh" 傪 /etc/passwd 偵
捛壛偡傞偩偗偱偡 (堷梡晞偼庢偭偰壓偝偄)丅曄峏偟偨偔側偄僼傿乕儖僪偼嬻偺
傑傑偵偟偰偍偔昁梫偑偁傝傑偡丅儐乕僓偺僐儞僩儘乕儖偵偼僱僢僩僌儖乕僾傪
梡偄傞偙偲傕偱偒傑偡丅

椺偊偽乽儘僌僀儞傾僋僙僗傪 miquiels, dth, ed 偲僱僢僩僌儖乕僾 sysadmin
偺儊儞僶乕偩偗偵尷傝偨偄偑丄傾僇僂儞僩僨乕僞偼懠偺儐乕僓慡堳暘偑昁梫乿
偲偄偆傛偆側応崌偼埲壓偺傛偆偵側傝傑偡丅

 

+miquels:::::::                                                        
+ed:::::::                                                             
+dth:::::::                                                            
+@sysadmins:::::::                                                     
-ftp                                                                   
+:*::::::/etc/NoShell                                                  

 

Linux 偱偼僷僗儚乕僪偺僼傿乕儖僪傕忋彂偒偱偒傞偙偲偵拲堄偟偰壓偝偄丅傗
傝曽偼崱偺椺偲慡偔摨偠偱偡丅偙偺椺偱偼 "ftp" 偺儘僌僀儞傕嶍彍偟偰偄傑偡
丅廬偭偰偙偺儐乕僓偼懚嵼偟側偔側傝丄 anonymous ftp 偼婡擻偟側偔側傝傑偡
丅

/etc/netgroup 僼傽僀儖偼埲壓偺傛偆偵側偭偰偄傞偲巚偄傑偡丅

sysadmins (-,software,) (-,kukuk,)                                     

廳梫丗僱僢僩僌儖乕僾偺婡擻偼 libc 4.5.26 偐傜幚憰偝傟傑偟偨丅 4.5.26 埲
慜偺 libc 傪巊偭偰偄傞 Linux 儅僔儞偱 ypbind 傪幚峴偡傞偲丄 NIS 偺僷僗
儚乕僪僨乕僞儀乕僗偵僄儞僩儕傪帩偮偡傋偰偺儐乕僓偼偦偺儅僔儞偵傾僋僙僗
偱偒偰偟傑偄傑偡両

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.3. NYS 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 

昁梫側偺偼 NIS 偺愝掕僼傽僀儖 (/etc/yp.conf) 偱惓偟偄僒乕僶(孮)偐傜忣曬
傪傕傜偊傞傛偆偵偟偰偍偔偙偲丄偦偟偰僱乕儉僒乕價僗僗僀僢僠偺愝掕僼傽僀
儖 (/etc/nsswitch.conf) 傪惓偟偔愝掕偡傞偙偲偱偡丅

ypbind 傕僀儞僗僩乕儖偟偰偍偒傑偟傚偆丅 libc 偵偼昁梫偁傝傑偣傫偑丄 NIS
(YP) 偺奺僣乕儖偵偼偙傟偑昁梫偵側傝傑偡丅

儐乕僓偺捛壛丒攔彍婡擻 (+/-guest/+@admins) 傪梡偄偨偄応崌偼丄 "passwd:
compat" 偲 "group: compat" 傪 nsswitch.conf 偱巜掕偡傞昁梫偑偁傝傑偡丅
"shadow: compat" 偲偄偆巜掕偼偁傝傑偣傫丅偙偺応崌偼 "shadow: files nis"
偺傛偆偵偟偰壓偝偄丅

NYS 偺僜乕僗偼 libc 5 偺僜乕僗偵摨崼偝傟偰偄傑偡丅 configure 傪幚峴偟丄
"Values correct" 偺栤偄偵懳偟偰堦搙栚偼 "NO" 偲摎偊偰壓偝偄丅偦偟偰
"Build a NYS libc from nys" 偵懳偟偰 "YES" 偲摎偊偰壓偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.4. glibc 2.x 傪梡偄偨 NIS 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞 

glibc 偼 trad-NIS 傪棙梡偟傑偡丅廬偭偰 ypbind 傪婲摦偡傞昁梫偑偁傝傑偡
丅傑偨僱乕儉僒乕價僗僗僀僢僠偺愝掕僼傽僀儖 (/etc/nsswitch.conf) 傕惓偟
偔愝掕偡傞昁梫偑偁傝傑偡丅 passwd/, shadow, group 偵 compat 儌乕僪傪巊
偆応崌偼丄偙傟傜偺僼傽僀儖偺嵟屻偵 "+" 傪捛壛偡傞昁梫偑偁傝傑偡丅儐乕僓
偺捛壛丒嶍彍婡擻傪梡偄傞偙偲傕偱偒傑偡丅愝掕偼 Solaris 2.x 偺傕偺偲傑偭
偨偔摨偠偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.5. nsswitch.conf 僼傽僀儖  

僱僢僩儚乕僋僒乕價僗僗僀僢僠偺僼傽僀儖 /etc/nsswitch.conf 偼丄忣曬傊偺
傾僋僙僗梫媮偑棃偨偲偒偵峴偆専嶕偺弴斣傪寛掕偡傞傕偺偱偡丅儂僗僩柤偺専
嶕偱梡偄傜傟傞 /etc/host.conf 僼傽僀儖偲帡偰偄傑偡丅椺偊偽偙偺僼傽僀儖
偵偍偄偰

hosts: files nis dns                                                   

偲巜掕偡傟偽丄儂僗僩柤偺専嶕婡擻偼傑偢儘乕僇儖偺 /etc/hosts 僼傽僀儖傪
扵偟丄師偵 NIS丄偦偟偰僪儊僀儞僱乕儉僒乕價僗 (/etc/resolv.conf 偲
named) 偲偄偆弴斣偱専嶕傪峴偄傑偡丅嵟屻傑偱儅僢僠偡傞傕偺偑側偗傟偽丄僄
儔乕偑曉偝傟傞偙偲偵側傝傑偡丅偙偺僼傽僀儖偼慡偰偺儐乕僓偐傜撉傒庢傝壜
擻偱側偗傟偽側傝傑偣傫両傛傝徻嵶側忣曬偼 nsswitch.5 偐 nsswitch.conf.5
偺儅僯儏傾儖儁乕僕傪尒偰偔偩偝偄丅

NIS 偱梡偄傞 /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                 Use NIS+ (NIS version 3)                 
#       nis                     Use NIS (NIS version 2), also called YP  
#       dns                     Use DNS (Domain Name Service)            
#       files                   Use the local files                      
#       db                      Use the /var/db databases                
#       [NOTFOUND=return]       Stop searching if not found so far       
#                                                                        
                                                                         
passwd:     compat                                                       
group:      compat                                                       
# For libc5, you must use shadow: files nis                              
shadow:     compat                                                       
                                                                         
passwd_compat: nis                                                       
group_compat: nis                                                        
shadow_compat: nis                                                       
                                                                         
hosts:      nis files dns                                                
                                                                         
services:   nis [NOTFOUND=return] files                                  
networks:   nis [NOTFOUND=return] files                                  
protocols:  nis [NOTFOUND=return] files                                  
rpc:        nis [NOTFOUND=return] files                                  
ethers:     nis [NOTFOUND=return] files                                  
netmasks:   nis [NOTFOUND=return] files                                  
netgroup:   nis                                                          
bootparams: nis [NOTFOUND=return] files                                  
publickey:  nis [NOTFOUND=return] files                                  
automount:  files                                                        
aliases:    nis [NOTFOUND=return] files                                  

passwd_compat, group_compat, shadow_compat 偼 glibc 2.x 偱偺傒僒億乕僩
偝傟偰偄傑偡丅 /etc/nsswitch.conf 偵 shadow 儖乕儖偑側偗傟偽丄 glibc 偼
僷僗儚乕僪偺専嶕偵 passwd 儖乕儖傪梡偄傑偡丅 glibc 梡偺専嶕儌僕儏乕儖偲
偟偰丄 hesoid 偺傛偆側傕偺傕懚嵼偟偰偄傑偡丅偙傟偵偮偄偰偼 glibc 偺暥彂
傪撉傫偱偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.6. Shadow 僷僗儚乕僪偲 NIS 

NIS 偵 shadow 僷僗儚乕僪傪棳捠偝偣傞偺偼椙偄峫偊偱偼偁傝傑偣傫丅 shadow
僔僗僥儉偺儊儕僢僩偱偁傞僙僉儏儕僥傿偑幐傢傟偰偟傑偆偐傜偱偡丅偦傟偵偙
傟偑僒億乕僩偝傟偰偄傞 Linux C 儔僀僽儔儕偼彮悢偵夁偓傑偣傫丅 NIS 偵
shadow 傪棳偝側偄傛偆偵偡傞偵偼丄儘乕僇儖僔僗僥儉偺儐乕僓偩偗傪 /etc/
shadow 偵搊榐偡傞偙偲偱偡丅 NIS 偵棳偡儐乕僓僄儞僩儕傪 shadow 僨乕僞儀
乕僗偐傜嶍彍偟丄偦傟傜偺僷僗儚乕僪偼 passwd 偵彂偄偰壓偝偄丅偙偆偡傟偽
root 儘僌僀儞偵偼 shadow 傪丄堦斒偺 NIS 儐乕僓偵偼 passwd 傪梡偄傞偙偲
偑偱偒傞傛偆偵側傝傑偡丅偙偺曽朄側傜丄偡傋偰偺 NIS 僋儔僀傾儞僩偱偆傑偔
摦嶌偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.6.1. Linux

NIS 偱 shadow 僷僗儚乕僪傪梡偄傞偙偲偑偱偒傞桞堦偺 Linux libc 偼 GNU C
Library 2.x 偱偡丅 Linux libc5 偼偙傟傪僒億乕僩偟偰偄傑偣傫丅 Linux
libc5 傪 NYS 偲堦弿偵僐儞僷僀儖偟偨応崌偼丄懡彮偺僐乕僪偑娷傑傟傞偙偲偵
偼側傝傑偡丅偱傕偙偺僐乕僪偼忬嫷偵傛偭偰偼傂偳偔夡傟偰偟傑偄丄 shadow
僄儞僩儕偑慡偰惓偟偄応崌偱傕摦嶌偟側偄偙偲偑偁傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.6.2. Solaris

Solaris 偼 NIS 宱桼偺 shadow 僷僗儚乕僪傪僒億乕僩偟偰偄傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7.6.3. PAM 

Linux-PAM 0.75 埲崀偱偼 NIS 宱桼偺 shadow 僷僗儚乕僪傪僒億乕僩偟偰偄傑
偡丅 pam_unix.so 儌僕儏乕儖偐丄奼挘儌僕儏乕儖偺 pam_unix2.so 傪巊偄傑偡
丅 pam_pwdb 傗 libpwdb 傪巊偭偰偄傞屆偄僔僗僥儉 (Red Hat Linux 5.x 側
偳) 偱偼丄 /etc/pam.d/* 偺僄儞僩儕傪曄峏偡傞昁梫偑偁傝傑偡丅 pam_pwdb
偺儖乕儖傪丄偡傋偰 pam_unix_* 儌僕儏乕儖宱桼偵抲偒姺偊傑偡丅

/etc/pam.d/login 偺椺傪師偵帵偟傑偡丅

#%PAM-1.0                                                                         
auth     requisite      pam_unix2.so            nullok #set_secrpc                
auth     required       pam_securetty.so                                          
auth     required       pam_nologin.so                                            
auth     required       pam_env.so                                                
auth     required       pam_mail.so                                               
account  required       pam_unix2.so                                              
password required       pam_pwcheck.so          nullok                            
password required       pam_unix2.so            nullok use_first_pass use_authtok 
session  required       pam_unix2.so            none # debug or trace             
session  required       pam_limits.so                                             

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

8. NIS+ 偺愝掕

8.1. 僜僼僩僂僃傾 

Linux 偺 NIS+ 僋儔僀傾儞僩僐乕僪偼 GNU C 儔僀僽儔儕偺僶乕僕儑儞 2 梡偵
奐敪偝傟偰偒傑偟偨丅偐偭偰偼彜梡傾僾儕働乕僔儑儞偺傎偲傫偳偑 libc5 偵儕
儞僋偝傟偰偄偰丄偦傟傜傪 glibc 偱嵞僐儞僷僀儖偡傞偙偲偼偱偒側偐偭偨偨傔
丄偙偺 NIS+ 僐乕僪傪 libc5 傊堏怉偟偨傕偺傕偁傝傑偡丅偨偩偟 libc5 偲
NIS+ 偺慻傒崌傢偣偵偼栤戣偑偁傝傑偡丅僗僞僥傿僢僋側僾儘僌儔儉偼 libc5
偵儕儞僋偡傞偙偲偼偱偒傑偣傫偟丄 libc5 儔僀僽儔儕娐嫬偱僐儞僷僀儖偟偨僾
儘僌儔儉偼懠偺僶乕僕儑儞偺 libc5 (傪巊偭偨僔僗僥儉) 偱偼摦嶌偟傑偣傫丅

儀乕僗偲側傞僔僗僥儉偲偟偰丄Debian, Red Hat Linux, SuSE Linux 偺傛偆側
glibc 儀乕僗偺僨傿僗僩儕價儏乕僔儑儞偑昁梫偱偡丅 glibc 2.1.1 埲崀傪旛偊
偰偄側偄僨傿僗僩儕價儏乕僔儑儞傪巊偭偰偄傞応崌偼丄怴偟偄斉偵傾僢僾僨乕
僩偡傞昁梫偑偁傝傑偡丅

NIS+ 僋儔僀傾儞僩偺僜僼僩僂僃傾偼埲壓偐傜擖庤偱偒傑偡丅

Site and Directory                      Filename                       
ftp.gnu.org:/pub/gnu/glibc/ <ftp://     glibc-2.3.2.tar.gz             
ftp.gnu.org/pub/gnu/glibc/>             glibc-linuxthreads-2.3.2.tar.gz
ftp.kernel.org:/pub/linux/utils/net/    nis-utils-1.4.1.tar.gz         
NIS+ <ftp://ftp.kernel.org/pub/linux/                                  
utils/net/NIS+/>                                                       

http://www.linux-nis.org/nisplus/ 偵偼丄傛傝徻嵶側忣曬偲嵟怴偺僜乕僗偑
偁傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

8.2. NIS+ 僋儔僀傾儞僩偺僙僢僩傾僢僾 

廳梫丗 NIS+ 僋儔僀傾儞僩傪僙僢僩傾僢僾偡傞慜偵丄 Solaris 偺 NIS+ 僪僉儏
儊儞僩傪撉傫偱僒乕僶懁偱昁梫側嶌嬈傪峴偭偰壓偝偄丅偙偺暥彂偱偼僋儔僀傾
儞僩懁偱偳偆偡傟偽傛偄偐偵偮偄偰偟偐弎傋偰偄傑偣傫両

怴偟偄 libc 偲 nis-tools 傪僀儞僗僩乕儖偟偨傜丄 NIS+ 僒乕僶忋偱偙偺怴偨
側僋儔僀傾儞僩梡偺怣擟徹 (credential) 傪嶌惉偟傑偡丅 portmap 偑摦嶌偟偰
偄傞偙偲傪妋擣偡傞傛偆偵偟偰壓偝偄丅師偵僋儔僀傾儞僩偵偡傞 Linux PC 偺
帪崗偑 NIS+ 僒乕僶偲堦抳偟偰偄傞偐僠僃僢僋偟偰壓偝偄丅 secure RPC 偺応
崌偼丄怣擟徹偺桳岠婜娫偼 3 暘偟偐偁傝傑偣傫丅偡傋偰偺儂僗僩偱 xntpd 傪
憱傜偣傞偺偑椙偄偱偟傚偆丅偙傟傜偑妋擣偱偒偨傜埲壓傪幚峴偟傑偡丅

 
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆domainname nisplus.domain.                                          劆
劆nisinit -c -H <NIS+ server>                                         劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
 

偙傟偵傛偭偰 cold 僗僞乕僩僼傽僀儖偑弶婜壔偝傟傑偡丅懠偺僆僾僔儑儞偵偮
偄偰偼 nisinit 偺儅僯儏傾儖儁乕僕傪撉傫偱壓偝偄丅僪儊僀儞僱乕儉偼儕僽乕
僩偺偨傃偵愝掕偝傟傞傛偆偵偟偰偍偄偰壓偝偄丅偁側偨偺僱僢僩儚乕僋偺 NIS+
僪儊僀儞僱乕儉偑傢偐傜側偄応崌偼丄僔僗僥儉偐僱僢僩儚乕僋偺娗棟幰偵恞偹
偰壓偝偄丅

師偵 /etc/nsswitch.conf 僼傽僀儖傪曄峏偟傑偡丅 publickey 偵彂偗傞僒乕價
僗偼 nisplus 偩偗 ("publickey: nisplus") 偱丄懠偺傕偺偼彂偄偰偼側傜側偄
偙偲偵拲堄偟偰壓偝偄丅

師偵 keyserv 傪婲摦偟偰壓偝偄丅偙傟偼僽乕僩帪偵丄昁偢 portmap 偺捈屻偵
婲摦偝傟傞傛偆偵偟偰偍偄偰壓偝偄丅偙偆偟偰
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆keylogin -r                                                         劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
偲偡傟偽僔僗僥儉偺 root 偺旈枾尞偑曐娗偝傟傑偡 (傕偆偙偺怴偟偄儂僗僩偺
岞奐尞傪 NIS+ 偺僒乕僶偵捛壛偟傑偟偨傛偹丠)丅

niscat passwd.org_dir 偲偡傟偽丄 passwd 僨乕僞儀乕僗偺偡傋偰偺僄儞僩儕
傪尒傞偙偲偑偱偒傞偼偢偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

8.3. NIS+ 偲 keylogin, login, PAM 

儘僌僀儞偟偨偲偒偵丄儐乕僓偼帺暘偺旈枾尞傪 keyserv 偵僙僢僩偡傞昁梫偑偁
傝傑偡丅偙傟偵偼 keylogin 傪梡偄傑偡丅 glibc 2.1 偲僐儞僷僀儖偟偨応崌偵
偼丄 shadow 僷僢働乕僕偺 login 偼偙傟傪儐乕僓偺戙傢傝偵幚峴偟偰偔傟傑偡
丅 PAM 傪擣幆偡傞 login 傪梡堄偡傞偵偼丄 pam_keylogin-1.2.tar.gz 傪僀儞
僗僩乕儖偟丄 /etc/pam.d/login 僼傽僀儖傪曄峏偟偰 pwdb 偺戙傢傝偵 pam&
_unix_auth 傪巊偆傛偆偵偡傞昁梫偑偁傝傑偡 (pwdb 偼 NIS+ 傪僒億乕僩偟傑
偣傫)丅椺傪帵偟傑偡丅

 

#%PAM-1.0                                                              
auth       required     /lib/security/pam_securetty.so                 
auth       required     /lib/security/pam_unix2.so       set_secrpc    
auth       required     /lib/security/pam_nologin.so                   
account    required     /lib/security/pam_unix2.so                     
password   required     /lib/security/pam_unix2.so                     
session    required     /lib/security/pam_unix2.so                     

 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

8.4. nsswitch.conf 僼傽僀儖  

僱僢僩儚乕僋僒乕價僗僗僀僢僠偺僼傽僀儖 /etc/nsswitch.conf 偼丄忣曬傊偺
傾僋僙僗梫媮偑棃偨偲偒偵峴偆専嶕偺弴斣傪寛掕偡傞傕偺偱偡丅儂僗僩柤偺専
嶕偱梡偄傜傟傞 /etc/host.conf 僼傽僀儖偲帡偰偄傑偡丅椺偊偽偙偺僼傽僀儖
偵偍偄偰

 

hosts: files nisplus dns                                               

 

偲巜掕偡傟偽丄儂僗僩柤偺専嶕婡擻偼傑偢儘乕僇儖偺 /etc/hosts 僼傽僀儖傪
扵偟丄師偵 NIS+丄偦偟偰僪儊僀儞僱乕儉僒乕價僗 (/etc/resolv.conf 偲
named) 偲尵偆弴斣偱専嶕傪峴偄傑偡丅嵟屻傑偱儅僢僠偡傞傕偺偑側偗傟偽僄儔
乕偑曉偝傟傞偙偲偵側傝傑偡丅

NIS+ 梡偺 /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                 Use NIS+ (NIS version 3)                 
#       nis                     Use NIS (NIS version 2), also called YP  
#       dns                     Use DNS (Domain Name Service)            
#       files                   Use the local files                      
#       db                      Use the /var/db databases                
#       [NOTFOUND=return]       Stop searching if not found so far       
#                                                                        
                                                                         
passwd:     compat                                                       
group:      compat                                                       
shadow:     compat                                                       
                                                                         
passwd_compat: nisplus                                                   
group_compat:  nisplus                                                   
shadow_compat: nisplus                                                   
                                                                         
hosts:      nisplus files dns                                            
                                                                         
services:   nisplus [NOTFOUND=return] files                              
networks:   nisplus [NOTFOUND=return] files                              
protocols:  nisplus [NOTFOUND=return] files                              
rpc:        nisplus [NOTFOUND=return] files                              
ethers:     nisplus [NOTFOUND=return] files                              
netmasks:   nisplus [NOTFOUND=return] files                              
netgroup:   nisplus                                                      
bootparams: nisplus [NOTFOUND=return] files                              
publickey:  nisplus                                                      
automount:  files                                                        
aliases:    nisplus [NOTFOUND=return] files                              

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

9. NIS 僒乕僶偺愝掕 

9.1. 僒乕僶僾儘僌儔儉 ypserv  

偙偺暥彂偱偼丄 NIS 僒乕僶偲偟偰偼 "ypserv" 偺愝掕曽朄偺傒傪婰偟傑偡丅

NIS 僒乕僶偺僜僼僩偼埲壓偵偁傝傑偡丅

Site and Directory                                   Filename          
ftp.kernel.org:/pub/linux/utils/net/NIS <ftp://      ypserv-2.9.tar.gz 
ftp.kernel.org/pub/linux/utils/net/NIS/>             ypserv-2.9.tar.bz2

http://www.linux-nis.org/nis/ 偵丄傛傝徻偟偄忣曬偑偁傝傑偡丅

僒乕僶偺僙僢僩傾僢僾曽朄偼 trad-NIS / NYS 偳偪傜偺応崌偱傕摨偠偱偡丅

僐儞僷僀儖偟偰 ypserv 偲 makedbm 傪嶌傝傑偡丅 securenets 僼傽僀儖傪巊偆
偐 ypserv-2.x 偱偼丄傾僋僙僗惂尷偵偼 securenets 僼傽僀儖傪梡偄傞曽朄偺
傒傪僒億乕僩偟偰偄傑偡丅

僒乕僶傪儅僗僞乕偲偟偰婲摦偡傞応崌偼丄 NIS 傪梡偄偰嫟桳偝偣傞僼傽僀儖傪
寛傔偰偔偩偝偄丅偦偟偰 /var/yp/Makefile 偺 "all" 儖乕儖偵昁梫側傕偺傪壛
偊偨傝丄晄梫側傕偺傪嶍彍偟偨傝偟偰偔偩偝偄丅傑偨 Makefile 偺愭摢偺曽傕
昁偢尒偰丄僆僾僔儑儞傪帺暘偺娐嫬偵偁傢偣偰曇廤偟偰偍偔傋偒偱偡丅

ypserv 1.1 偲 ypserv 1.2 偲偺娫偱偼丄戝偒側曄峏偑峴傢傟傑偟偨丅 1.2 埲
崀偱偼丄僼傽僀儖僴儞僪儖偑僉儍僢僔儏偝傟傞傛偆偵側偭偨偺偱偡丅偙傟偵傛
傝丄怴偟偄儅僢僾傪惗惉偡傞偲偒偵偼昁偢 makedbm 偵 -c 僆僾僔儑儞傪偮偗側
偗傟偽側傜側偔側傝傑偟偨丅 /var/yp/Makefile 偑 ypserv 1.2 埲崀偵晅懏偺
怴偟偄傕偺偱偁傞偙偲傪妋擣偟偰壓偝偄丅偁傞偄偼 Makefile 拞偺 makedbm 偵
-c 僼儔僌傪壛偊偰壓偝偄丅偙傟傪朰傟傞偲丄ypserv 偼峏怴偝傟偨儅僢僾偱偼
側偔丄屆偄儅僢僾傪巊偄懕偗偰偟傑偄傑偡丅

師偵 /var/yp/securenets 偲 /etc/ypserv.conf 傪曇廤偟傑偡丅徻嵶偼 ypserv
(8) 偲 ypserv.conf(5) 偺儅僯儏傾儖儁乕僕傪撉傫偱壓偝偄丅

億乕僩儅僢僷 (rpc.portmap) 偑摦偄偰偄傞偐妋擣偟偰壓偝偄丅妋擣偱偒偨傜 
ypserv 傪摦偐偟傑偡丅

 
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% rpcinfo -u localhost ypserv                                       劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
 

偲偄偆僐儅儞僪傪幚峴偟偰傒偰丄
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆program 100004 version 1 ready and waiting                          劆
劆program 100004 version 2 ready and waiting                          劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
偲弌椡偝傟傞偙偲傪妋擣偟偰壓偝偄丅

"version 1" 偺峴偼丄 ypserv 偺僶乕僕儑儞傗梡偄偨愝掕偵傛偭偰偼弌側偄偐
傕偟傟傑偣傫丅偙傟偑昁梫偵側傞偺偼愄偺 SunOS 4.x 傪僋儔僀傾儞僩偲偟偰巊
偆応崌偩偗偱偡丅

偙偙偱 NIS (YP) 僨乕僞傪嶌惉偟傑偡丅儅僗僞乕僒乕僶偱埲壓傪幚峴偟偰壓偝
偄丅

 
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% /usr/lib/yp/ypinit -m                                             劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
 

僗儗乕僽僒乕僶偱 ypwhich -m 偑婡擻偡傞偙偲傪妋擣偟偰壓偝偄丅偮傑傝丄僗
儗乕僽偵偡傞儂僗僩偼丄傑偢 NIS 僋儔僀傾儞僩偲偟偰摦嶌偱偒側偗傟偽側傜側
偄偺偱偡丅妋擣偱偒偨傜埲壓傪幚峴偟偰丄偙偺儂僗僩傪 NIS 僗儗乕僽偵偟傑偡
丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% /usr/lib/yp/ypinit -s masterhost                                  劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偙傟偱偍偟傑偄丄僒乕僶偼摦嶌偟偰偄傞偼偢偱偡丅

壗偐戝偒側栤戣偑惗偠偨傜丄 ypserv 傗 ypbind 傪暿偺 xterm 偐傜僨僶僢僌儌
乕僪偱婲摦偟偰傒傑偟傚偆丅僨僶僢僌弌椡偐傜壗偑栤戣側偺偐偑敾抐偱偒傞偼
偢偱偡丅

儅僢僾傪峏怴偡傞昁梫偑惗偠偨応崌偼丄 NIS 儅僗僞乕偺 /var/yp 僨傿儗僋僩
儕偱 make 傪幚峴偟偰偔偩偝偄丅僜乕僗僼傽僀儖偑怴偟偄応崌偵偼儅僢僾偑峏
怴偝傟丄僗儗乕僽僒乕僶偵 push 偝傟傑偡丅儅僢僾偺峏怴偵偼 ypinit 偼梡偄
側偄傛偆偵偟偰偔偩偝偄丅

乽僗儗乕僽乿僒乕僶忋偱偼 root 偺 crontab 傪曇廤偟丄埲壓偺傛偆側峴傪捛壛
偟偰偍偔偲椙偄偐傕偟傟傑偣傫丅

20 *    * * *    /usr/lib/yp/ypxfr_1perhour                            
40 6    * * *    /usr/lib/yp/ypxfr_1perday                             
55 6,18 * * *    /usr/lib/yp/ypxfr_2perday                             

枩偑堦儅僗僞僒乕僶偱偺峏怴偺嵺偵僗儗乕僽偑僟僂儞偟偰偄偰僨乕僞傪庴偗懝
側偭偰傕丆偙傟偵傛偭偰 NIS 儅僢僾傪嵟怴偵曐偮偙偲偑偱偒傑偡丅

僗儗乕僽偼偄偮偱傕捛壛偡傞偙偲偑偱偒傑偡丅傑偢怴偟偔僀儞僗僩乕儖偟偨僗
儗乕僽僒乕僶偑 NIS 儅僗僞乕偵愙懕偡傞嫋壜傪帩偭偰偄傞偐傪妋擣偟傑偟傚偆
丅師偵
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% /usr/lib/yp/ypinit -s masterhost                                  劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
傪怴偟偄僗儗乕僽偱幚峴偟傑偡丅儅僗僞乕僒乕僶偱偼丄偙偺怴偟偄僗儗乕僽僒
乕僶偺柤慜傪 /var/yp/ypservers 偵捛壛偟丄 /var/yp 偱 make 傪幚峴偟偰儅
僢僾傪峏怴偟傑偡丅

NIS 僒乕僶傊偺儐乕僓傾僋僙僗傪惂尷偟偨偄応崌偼丄 NIS 僒乕僶偺儂僗僩傪僋
儔僀傾儞僩偲偟偰傕幚峴偡傞昁梫偑偁傝傑偡丅偮傑傝 ypbind 傪幚峴偟偰 "+"
偺晅偄偨僄儞僩儕傪僷僗儚乕僪僼傽僀儖 /etc/passwd 偺搑拞偵捛壛偟傑偡丅儔
僀僽儔儕娭悢偼 NIS 僄儞僩儕埲崀偵抲偐傟偨捠忢偺僄儞僩儕傪慡偰柍帇偟丄巆
傝傪 NIS 傪捠偟偰庢摼偟傑偡丅偙偺傛偆偵偡傞偲 NIS 偺傾僋僙僗儖乕儖傪娗
棟偡傞偙偲偑偱偒傑偡丅椺傪帵偟傑偡丅

 

root:x:0:0:root:/root:/bin/bash                                           
daemon:*:1:1:daemon:/usr/sbin:                                            
bin:*:2:2:bin:/bin:                                                       
sys:*:3:3:sys:/dev:                                                       
sync:*:4:100:sync:/bin:/bin/sync                                          
games:*:5:100:games:/usr/games:                                           
man:*:6:100:man:/var/catman:                                              
lp:*:7:7:lp:/var/spool/lpd:                                               
mail:*:8:8:mail:/var/spool/mail:                                          
news:*:9:9:news:/var/spool/news:                                          
uucp:*:10:50:uucp:/var/spool/uucp:                                        
nobody:*:65534:65534:noone at all,,,,:/dev/null:                          
+miquels::::::                                                            
+:*:::::/etc/NoShell                                                      
[ All normal users AFTER this line! ]                                     
tester:*:299:10:Just a test account:/tmp:                                 
miquels:1234567890123:101:10:Miquel van Smoorenburg:/home/miquels:/bin/zsh

 

偙偺傛偆偵儐乕僓 "tester" 偼懚嵼偟傑偡偑丄僔僃儖偑 /etc/NoShell 偵側傝
傑偡丅 miquels 偼捠忢偺傾僋僙僗尃傪帩偮偙偲偵側傝傑偡丅

偁傞偄偼 /var/yp/Makefile 僼傽僀儖傪曇廤偟丄 NIS 偑巊偆僷僗儚乕僪僼傽僀
儖傪暿偵巜掕偡傞偙偲傕偱偒傑偡丅戝偒側僔僗僥儉偱偼丄NIS 偺僷僗儚乕僪僼
傽僀儖偲僌儖乕僾僼傽僀儖偼捠忢 /var/yp/ypfiles 偵抲偔偙偲偑懡偄傛偆偱偡
丅偙偺傛偆偵偡傞偲僷僗儚乕僪僼傽僀儖娭楢偺娗棟僣乕儖偼巊偊側偔側傝傑偡
丅偮傑傝 passwd, chfn, adduser 側偳偵懳偟丄摿暿側僣乕儖偑昁梫偵側傝傑偡
丅

偟偐偟 yppasswd, ypchsh, ypchfn 偼摉慠摦嶌偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

9.2. 僒乕僶僾儘僌儔儉 yps  

NIS 僒乕僶 yps 偺愝掕偼慜偺僙僋僔儑儞傪嶲峫偵偟偰壓偝偄丅戝懱帡偰偄傑偡
偑姰慡偵摨偠偱偼側偄偺偱丄 ypserv 偺愢柧傪揔梡偡傞嵺偵偼拲堄偟偰壓偝偄
丅 yps 偼傕偼傗扤傕僒億乕僩偟偰偄傑偣傫偟丄偄偔偮偐僙僉儏儕僥傿儂乕儖傕
懚嵼偟偰偄傑偡丅巊偆傋偒偱偼偁傝傑偣傫両

yps 偺僜僼僩偼埲壓偺僒僀僩偵偁傝傑偡丅

Site and Directory                                      Filename       
ftp.lysator.liu.se:/pub/NYS/servers <ftp://             yps-0.21.tar.gz
ftp.lysator.liu.se/pub/NYS/servers/>                                   
ftp.kernel.org:/pub/linux/utils/net/NIS <ftp://         yps-0.21.tar.gz
ftp.kernel.org/pub/linux/utils/net/NIS/>                               

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

9.3. rpc.ypxfrd 僾儘僌儔儉  

rpc.ypxfrd 偼旕忢偵戝偒側 NIS 儅僢僾傪 NIS 儅僗僞乕偐傜 NIS 僗儗乕僽僒
乕僶乕偵揮憲偡傞嵺偵丄揮憲傪崅懍壔偡傞偨傔偵梡偄傜傟傑偡丅 NIS 僗儗乕僽
僒乕僶乕偼丄怴偟偄儅僢僾偑偁傞偲偄偆儊僢僙乕僕傪庴偗庢傞偲丄偦偺儅僢僾
傪庢摼偡傞偨傔偵 ypxfr 傪婲摦偟傑偡丅 ypxfr 偼 yp_all() 娭悢傪梡偄偰儅
僢僾偺撪梕傪儅僗僞乕僒乕僶乕偐傜撉傒崬傕偆偲偟傑偡丅偙偺忣曬偼僨乕僞乕
儀乕僗儔僀僽儔儕傪捠偟偰曐懚偝傟傞偨傔丄儅僢僾偺僒僀僘偑旕忢偵戝偒偔側
傞偲丄偙偺僾儘僙僗偼悢暘傕偐偐偭偰偟傑偆偙偲偑偁傝傑偡丅

rpc.ypxfrd 僒乕僶乕偼丄 NIS 僗儗乕僽僒乕僶乕偵儅僗僞乕偺儅僢僾僼傽僀儖
傪扨弮偵僐僺乕偝偣丄揮憲僾儘僙僗傪崅懍壔偟傑偡丅僗儗乕僽僒乕僶乕偑僛儘
偐傜帺慜偺儅僢僾傪惗惉偡傞偺偵斾傋丄偙傟偼偢偭偲抁帪娫偱偡傒傑偡丅
rpc.ypxfrd 偼 RPC 儀乕僗偺揮憲僾儘僩僐儖傪梡偄傞偺偱丄怴偟偄儅僢僾傪惗
惉偡傞昁梫偼偁傝傑偣傫丅

rpc.ypxfrd 偼 inetd 偐傜婲摦偡傞偙偲傕偱偒傑偡偑丄婲摦偵偼帪娫偑偐偐傞
偺偱丄 ypserv 偲堦弿偵僨乕儌儞偲偟偰婲摦偟偰偍偔傎偆偑偄偄偱偟傚偆丅
rpc.ypxfrd 偼 NIS 儅僗僞乕僒乕僶偱偩偗婲摦偟偰偍偗偽 OK 偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

9.4. rpc.yppasswdd 僾儘僌儔儉  

儐乕僓偑僷僗儚乕僪傪曄峏偟偨偲偒偵偼丄 NIS 偺僷僗儚乕僪僨乕僞儀乕僗傗丄
偦傟偵埶懚偟偨懠偺 NIS 僨乕僞儀乕僗傕曄峏偝傟側偗傟偽側傟傑偣傫丅偙傟傪
峴側偆偺偑 rpc.yppasswdd 偱偡丅偙偺僾儘僌儔儉偼僷僗儚乕僪曄峏傪庢傝埖偄
丄 NIS 偺忣曬偑惓偟偔峏怴偝傟傞傛偆偵偟傑偡丅尰嵼 rpc.yppasswdd 偼
ypserv 偺堦晹偲側偭偰偄傑偡丅暿僷僢働乕僕偵側偭偰偄傞
yppasswd-0.9.tar.gz 傗 yppasswd-0.10.tar.gz 側偳偼屆偄偺偱巊偆昁梫偼偁
傝傑偣傫偟丄傑偨崱屻巊偆傋偒偱偼偁傝傑偣傫丅

rpc.yppasswdd 傪幚峴偡傞偺偼 NIS 儅僗僞乕僒乕僶偺傒偱偡丅僨僼僅儖僩偱偼
丄儐乕僓乕偼僼儖僱乕儉傗儘僌僀儞僔僃儖傪曄峏偡傞偙偲偑偱偒側偄傛偆偵側
偭偰偄傑偡丅偙傟傪嫋壜偡傞偵偼丄偦傟偧傟 -e chfn 偍傛傃 -e chsh 僆僾僔
儑儞傪巜掕偟傑偡丅

passwd 偲 shadow 僼傽僀儖偑 /etc 埲奜偵偁傞応崌偼丄 -D 僆僾僔儑儞傪巜掕
偡傞昁梫偑偁傝傑偡丅椺偊偽慡偰偺僜乕僗僼傽僀儖傪 /etc/yp 偵抲偄偰丄儐乕
僓偵僔僃儖偺曄峏傪壜擻偵偟偨偄応崌偼丄 rpc.yppasswdd 傪埲壓偺僷儔儊乕僞
偱幚峴偟側偗傟偽側傝傑偣傫:
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆# rpc.yppasswdd -D /etc/yp -e chsh                                  劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
傑偨偼
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆# rpc.yppasswdd -s /etc/yp/shadow -p /etc/yp/passwd -e chsh         劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
偱傕 OK 偱偡丅

懠偵偼摿偵偡傞偙偲偼偁傝傑偣傫丅偨偩丄 rpc.yppasswdd 偑 /var/yp/
Makefile 偲摨偠僼傽僀儖傪巊偭偰偄傞偐偳偆偐偼婥傪偮偗偰偍偄偰偔偩偝偄丅
僄儔乕偼 syslog 傪捠偟偰婰榐偝傟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

10. NIS/NYS 僀儞僗僩乕儖偺僠僃僢僋  

偡傋偰偑偆傑偔峴偭偨傜丄娙扨側僐儅儞僪傪巊偭偰僀儞僗僩乕儖偺僠僃僢僋傪
峴偭偰壓偝偄丅椺偊偽僷僗儚乕僪僼傽僀儖偑 NIS/NYS 偱嫟桳偝傟偰偄傞応崌偼
丄

 
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% ypcat passwd                                                      劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
 

偲偄偆僐儅儞僪偱 NIS 偺僷僗儚乕僪僼傽僀儖偺撪梕偑尒傜傟傞偼偢偱偡丅傑偨

 
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% ypmatch userid passwd                                             劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
 

偲偡傟偽丄巜掕偟偨儐乕僓偺僄儞僩儕偑僷僗儚乕僪僼傽僀儖偐傜庢傝弌偝傟偰
昞帵偝傟傑偡 (userid 偵偼揔摉側儐乕僓偺儘僌僀儞柤傪擖傟傑偡)丅側偍 
ypcat 傗 ypmatch 偼丄 trad-NIS 傗 NYS 偺攝晍僷僢働乕僕偵擖偭偰偄傑偡丅

儐乕僓乕偵傛傞儘僌僀儞偑偱偒側偄応崌偵偼丄埲壓偺僾儘僌儔儉傪僋儔僀傾儞
僩偱幚峴偟偰傒偰壓偝偄丅

#include <stdio.h>                                                     
#include <pwd.h>                                                       
#include <sys/types.h>                                                 
                                                                       
int                                                                    
main(int argc, char *argv[])                                           
{                                                                      
  struct passwd *pwd;                                                  
                                                                       
  if(argc != 2)                                                        
    {                                                                  
      fprintf(stderr,"Usage: getwpnam username\n");                    
      exit(1);                                                         
    }                                                                  
                                                                       
  pwd=getpwnam(argv[1]);                                               
                                                                       
  if(pwd != NULL)                                                      
    {                                                                  
      printf("name.....: [%s]\n",pwd->pw_name);                        
      printf("password.: [%s]\n",pwd->pw_passwd);                      
      printf("user id..: [%d]\n", pwd->pw_uid);                        
      printf("group id.: [%d]\n",pwd->pw_gid);                         
      printf("gecos....: [%s]\n",pwd->pw_gecos);                       
      printf("directory: [%s]\n",pwd->pw_dir);                         
      printf("shell....: [%s]\n",pwd->pw_shell);                       
    }                                                                  
  else                                                                 
    fprintf(stderr,"User \"%s\" not found!\n",argv[1]);                
                                                                       
  exit(0);                                                             
}                                                                      

偙偺僾儘僌儔儉傪儐乕僓柤傪僷儔儊乕僞偲偟偰幚峴偟傑偡偲丄偦偺儐乕僓偵懳
偟偰 getpwnam 娭悢偑曉偡忣曬偑慡偰昞帵偝傟傑偡丅偙傟偵傛偭偰丄偳偺僄儞
僩儕偑娫堘偭偰偄傞偐偑傢偐傞偱偟傚偆丅傛偔偁傞娫堘偄偲偟偰偼丄僷僗儚乕
僪偺僼傿乕儖僪偑 "*" 偵傛偭偰忋彂偒偝傟偰偄傞丄側偳偑偁傝傑偡丅

GNU C Library 2.1 (glibc 2.1) 偵偼 getent 偲偄偆僣乕儖偑偮偄偰偒傑偡丅
偦偺傛偆側僔僗僥儉偱偼丄忋婰偺戙傢傝偵偙偪傜傪巊偄傑偟傚偆丅
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% getent passwd                                                     劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
傗
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% getent passwd login                                               劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
偺傛偆偵帋偟偰傒傑偟傚偆丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

11. NIS 儅僢僾偺惗惉偲峏怴 

11.1. NIS 儅僢僾偺惗惉 

嵟弶偺 NIS 儅僢僾偼丄師偺僐儅儞僪傪幚峴偟偰惗惉偟傑偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% /usr/lib/yp/ypinit -m                                             劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偙傟偼 NIS 儅僗僞乕僒乕僶傪偼偠傔偰愝掕偟偨偲偒偵峴偄傑偡丅偙傟偵娭偡傞
徻嵶偼 Section 9 傪尒偰偔偩偝偄丅僒乕僶偵怴偟偄儅僢僾傪捛壛偟偨傝丄屆偄
儅僢僾傪嶍彍偟偨傝偟偨偄応崌偼丄 /var/yp/Makefile 傪曇廤偟偰 all: 儖乕
儖傪曄峏偟傑偡丅儅僢僾傪惗惉偡傞儖乕儖偺柤慜傪偙偙偵捛壛丒嶍彍偟傑偡丅

儅僢僾傪嶍彍偡傞応崌偼丄懳墳偡傞幚嵺偺僼傽僀儖傕嶍彍偟側偗傟偽側傝傑偣
傫丅

偙偺曄峏傪峴偭偨傜丄

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% make -C /var/yp                                                   劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

傪幚峴偡傟偽儅僢僾偑惗惉偝傟傞偼偢偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

11.2. NIS 儅僢僾傪峏怴偡傞 

NIS 儅僢僾偺僜乕僗傪曄峏偟偨傜 (椺偊偽怴偟偄儐乕僓偺傾僇僂儞僩傪 passwd
僼傽僀儖偵捛壛偟偨応崌側偳)丄 NIS 儅僢僾傪嵞惗惉偡傞昁梫偑偁傝傑偡丅扨
偵師偺僐儅儞僪傪幚峴偡傞偩偗偱偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆% make -C /var/yp                                                   劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偙偺僐儅儞僪偼偳偺僜乕僗偑曄峏偝傟偨偐傪挷傋丄怴偟偄儅僢僾傪惗惉偟丄
ypserv 偵儅僢僾偑曄峏偝傟偨偙偲傪揱偊傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

11.3. 儅僢僾偺僄儞僩儕偺挿偝 

NIS 僾儘僩僐儖偱偼丄傂偲偮偺僄儞僩儕偺挿偝偼 1024 暥帤傑偱偵惂尷偝傟偰
偄傑偡丅偙偺抣傪扨弮偵憹傗偟偰嵞僐儞僷僀儖偡傞偙偲偼弌棃傑偣傫丅 NIS v2
傪巊偭偰偄傞僔僗僥儉偼偡傋偰丄僉乕偲僨乕僞偺抣偑 1024 僶僀僩埲壓偺僒僀
僘偵廂傑傞偙偲傪憐掕偟偰偄傞偨傔偱偡丅帺暘偺娗棟偟偰偄傞僋儔僀傾儞僩偲
僒乕僶偱撍慠 YPMAXRECORD 傪憹傗偡偲丄僱僢僩儚乕僋偱 NIS 傪棙梡偟偰偄傞
懠偺儅僔儞偲偺憡屳塣梡惈傪懝側偆偙偲偵側傝傑偡丅惓偟偔摦嶌偝偣傞偵偼丄
NIS 傪僒億乕僩偟偰偄傞偡傋偰偺儀儞僟偺偲偙傠偵偄偭偰丄摨帪偵曄峏傪峴傢
偣傞昁梫偑偁傝傑偡丅傑偢偙傫側偙偲偼柍棟偱偟傚偆丅

glibc 2.1 埲崀偱偼丄偙偺惂尷偼 glibc 偺 NIS 幚憰偐傜偼柍偔側偭偰偄傑偡
丅廬偭偰 Linux 偱偼丄傛傝挿偄僄儞僩儕傪棙梡偱偒傑偡丅偟偐偟偙傟偼忋婰偺
捠傝丄僱僢僩儚乕僋偵懠偺 NIS 僋儔僀傾儞僩傗僒乕僶偑柍偄応崌偵尷傝傑偡丅

挿偄僄儞僩儕偺 NIS 儅僢僾傪惗惉偡傞偵偼丄 /var/yp/Makefile 偑 makedbm
傪屇傇嵺偵丄 --no-limit-check 僆僾僔儑儞傪捛壛偡傞傛偆偵偟傑偡丅

埲壓偺傛偆側姶偠偵側傝傑偡:

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆DBLOAD = $(YPBINDIR)/makedbm -c -m `$(YPBINDIR)/yphelper --hostname` --no-limit-check 劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

寈崘: 偙偺曄峏偼 NIS 僾儘僩僐儖偵斀偟偰偄傑偡丅 Linux 帺恎偼僒億乕僩偟
偰偄傞偲偼偄偊丄 Linux 忋偱摦嶌偡傞傾僾儕働乕僔儑儞偑丄偙偺曄峏屻偵摦嶌
偡傞偐偳偆偐偼傢偐傝傑偣傫!

/etc/group 僄儞僩儕偺応崌偵偼丄偙偺栤戣傪夞旔偡傞偨傔偺暿朄偑偁傝傑偡丅
偙偺傾僀僨傿傾偼 Ken Cameron 偐傜婑偣傜傟傑偟偨丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆1. 僄儞僩儕傪暋悢偺峴偵暘偗丄奺僌儖乕僾偺柤慜傪偪傚偭偲偢偮         劆
劆   曄偊傑偡丅                                                       劆
劆                                                                    劆
劆2. 偙偺奺僌儖乕僾偺 GID 偼慡晹摨偠偵偟傑偡丅                        劆
劆                                                                    劆
劆3. 嵟弶偺僄儞僩儕偵偼丄惓偟偄僌儖乕僾柤偲 GID 傪梌偊傑偡丅          劆
劆   巹偼偙偙偵偼儐乕僓柤偼抲偐側偄傛偆偵偟偰偄傑偡丅                 劆
劆                                                                    劆
劆偙偺寢壥丄僾儘僌儔儉偑偙偺儅僢僾傪撉傓偲丄巜掕偟偨儐乕僓柤偵懳偟偰  劆
劆GID 偑婣傝傑偡丅師偵 GID 偵儅僢僠偡傞嵟弶偺僄儞僩儕傪尒偮偗傞偲丄   劆
劆偦偺柤慜傪曉偟偰掆巭偟傑偡丅旤偟偔偼偁傝傑偣傫偑丄摦嶌偟傑偡!       劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12. 嵞婲摦帪偺帺摦幚峴

NIS 偑僒乕僶傗僋儔僀傾儞僩偱惓偟偔愝掕偱偒偨傜丄偙偺愝掕偑婲摦帪偵傕惓
偟偔斀塮偝傟傞偐傪妋擣偟側偗傟偽側傝傑偣傫丅

僠僃僢僋偡傞揰偼 2 偮偁傝傑偡丅婲摦僗僋儕僾僩偑偁傞偐偳偆偐偲丄 NIS 僪
儊僀儞柤偑惓偟偄応強偵曐懚偝傟偰偄傞偐偳偆偐丄偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.1. NIS 梡偺婲摦僗僋儕僾僩

偁側偨偺巊偭偰偄傞 Linux 偱偺婲摦僗僋儕僾僩偺抲応強偵側偭偰偄傞僨傿儗僋
僩儕傪挷傋傑偟傚偆丅 /etc/init.d, /etc/rc.d/init.d, /sbin/init.d 側偳偵
側偭偰偄傞偲巚偄傑偡丅 NIS 偺婲摦僗僋儕僾僩偑偁傞偐偳偆偐妋擣偟傑偟傚偆
丅僼傽僀儖偺柤慜偼傆偮偆 ypbind 偲偐 ypclient 偲側偭偰偄傞傛偆偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.2. NIS 僪儊僀儞柤

偍偦傜偔堦晹偺恖乆偵偲偭偰丄 NIS 傪巊偆忋偱偺嵟戝偺擄娭偼丄 NIS 僪儊僀
儞柤傪嵞婲摦屻偵傕庢摼偱偒傞傛偆偵偡傞偙偲偱偟傚偆丅 Solaris 2.x 偱偼丄
NIS 僪儊僀儞柤偼 /etc/defaultdomain 偵 1 峴偱彂偐傟偰偄傑偟偨丅偟偐偟丄
傎偲傫偳偺 Linux 僨傿僗僩儕價儏乕僔儑儞偼偙偺僼傽僀儖傪巊偭偰偄側偄傛偆
偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3. 僨傿僗僩儕價儏乕僔儑儞屌桳偺榖戣

尰嵼偺偲偙傠丄偄傠偄傠側 Linux 僨傿僗僩儕價儏乕僔儑儞偵偍偗傞 NIS 僪儊
僀儞柤偺曐娗応強偼丄埲壓偺傛偆偵側偭偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3.1. Caldera 2.xx

Caldera 偼 /etc/nis.conf 僼傽僀儖傪梡偄偰偄傑偡丅彂幃偼捠忢偺 /etc/
yp.conf 偲摨偠偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3.2. Debian

Debian 偼 Sun 偲摨偠偔 /etc/defaultdomain 傪巊偭偰偄傞傛偆偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3.3. Red Hat Linux 6.x, 7.x, 8, 9

/etc/sysconfig/network 僼傽僀儖偺 NISDOMAIN 曄悢傪廋惓 (側偗傟偽嶌惉)
偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3.4. SuSE Linux 6.x 偲 7.x

/etc/rc.config 僼傽僀儖偺 YP_DOMAINNAME 曄悢傪廋惓偟偰 SuSEconfig 僐儅
儞僪傪幚峴偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

12.3.5. SuSE Linux 8.x 埲崀

8.0 埲崀偺 SuSE Linux 偱偼丄Sun 偲摨偠偔 /etc/defaultdomain 傪巊偆傛偆
偵側傝傑偟偨丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

13. rpasswd 偱僷僗儚乕僪傪曄峏偡傞 

NIS 僷僗儚乕僪傪曄峏偡傞昗弨揑側曽朄偼 yppasswd 傪屇傇偙偲偱丄偙傟偼僔
僗僥儉偵傛偭偰偼扨偵 passwd 偺僄僀儕傾僗偵側偭偰偄傞偙偲傕偁傝傑偡丅偙
偺僐儅儞僪偼 yppasswd 僾儘僩僐儖傪梡偄傞偺偱丄 NIS 儅僗僞乕僒乕僶偱 
rpc.yppasswdd 僾儘僙僗偑摦嶌偟偰偄傞昁梫偑偁傝傑偡丅偙偺僾儘僩僐儖偵偼
丄屆偄僷僗儚乕僪偑僱僢僩儚乕僋偵暯暥偱棳傟偰偟傑偆偲偄偆寚揰偑偁傝傑偡
丅僷僗儚乕僪偺曄峏偵惉岟偡傟偽丄偙傟偼偦傟傎偳栤戣偱偼偁傝傑偣傫丅偙偺
応崌屆偄僷僗儚乕僪偼怴偟偄僷僗儚乕僪偵抲偒姺傢傞偐傜偱偡丅偟偐偟僷僗儚
乕僪偺曄峏偵幐攕偡傞偲丄峌寕幰偼偙偺暯暥偺僷僗儚乕僪傪梡偄丄偦偺儐乕僓
偲偟偰儘僌僀儞偱偒偰偟傑偄傑偡丅偝傜偵傑偢偄偙偲偵偼丄僔僗僥儉娗棟幰偑
懠偺儐乕僓偺 NIS 僷僗儚乕僪傪曄峏偡傞応崌丄 NIS 儅僗僞乕僒乕僶偺 root
僷僗儚乕僪偑僱僢僩儚乕僋傪暯暥偱棳傟偰偟傑偄傑偡丅偦偟偰偙偺僷僗儚乕僪
偼曄峏偝傟側偄偺偱偡丅

夝寛嶔偺傂偲偮偼丄僷僗儚乕僪偺曄峏偵 yppasswd 傪梡偄側偄偙偲偱偡丅戙傢
傝偵巊偊傞椙偄僾儘僌儔儉偑丄 pwdutils 僷僢働乕僕偵擖偭偰偄傞 rpasswd 偱
偡丅

Site and Directory                              Filename               
ftp.kernel.org:/pub/linux/utils/net/NIS <ftp:// pwutils-2.3.tar.gz     
ftp.kernel.org/pub/linux/utils/net/NIS/>                               
ftp.suse.com:/pub/people/kukuk/pam/pam_pwcheck  pam_pwcheck-2.2.tar.bz2
<ftp://ftp.suse.com/pub/people/kukuk/pam/                              
pam_pwcheck/>                                                          
ftp.suse.com:/pub/people/kukuk/pam/pam_unix2    pam_unix2-1.16.tar.bz2 
<ftp://ftp.suse.com/pub/people/kukuk/pam/                              
pam_unix2/>                                                            

rpasswd 偼儕儌乕僩僒乕僶偺儐乕僓傾僇僂儞僩偺僷僗儚乕僪傪丄埨慡側 SSL 愙
懕傪捠偟偰曄峏偟傑偡丅捠忢偺儐乕僓偼帺暘偺僷僗儚乕僪偩偗傪曄峏偱偒丄娗
棟幰偺僷僗儚乕僪 (尰嵼偼僒乕僶偺 root 偺僷僗儚乕僪) 傪抦偭偰偄傞儐乕僓
偼丄 rpasswd 偵 -a 僆僾僔儑儞傪偮偗傟偽偁傜備傞儐乕僓偺僷僗儚乕僪傪曄峏
偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

13.1. 僒乕僶偺愝掕 

僒乕僶偱偼傑偢徹柧彂 (certificate) 偑昁梫偱偡丅徹柧彂偺僨僼僅儖僩偺僼傽
僀儖柤偼 /etc/rpasswdd.pem 偱偡丅偙偺僼傽僀儖偼師偺僐儅儞僪偱嶌惉偱偒傑
偡丅
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆openssl req -new -x509 -nodes -days 730 -out /etc/rpasswdd.pem -keyout /etc/rpasswdd.pem劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

rpasswdd 梡偺 PAM 愝掕傕昁梫偱偡丅 NIS 傾僇僂儞僩偑 /etc/passwd 偵曐懚
偝傟偰偄傞応崌偼丄師偺傛偆側傕偺傪尒杮偵愝掕偟偰傒傞偲椙偄偱偟傚偆丅
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆#%PAM-1.0                                                           劆
劆auth     required       pam_unix2.so                                劆
劆account  required       pam_unix2.so                                劆
劆password required       pam_pwcheck.so                              劆
劆password required       pam_unix2.so    use_first_pass use_authtok  劆
劆password required       pam_make.so     /var/yp                     劆
劆session  required       pam_unix2.so                                劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

NIS 僷僗儚乕僪儅僢僾偺僜乕僗偑暿偺応強 (椺偊偽 /etc/yp 側偳) 偵偁傞応崌
偵偼丄 pam_unix2 偺 nisdir 僆僾僔儑儞傪巊偆偲丄偙偺応強傪嶲徠偱偒傑偡丅
劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆#%PAM-1.0                                                                         劆
劆auth     required       pam_unix2.so                                              劆
劆account  required       pam_unix2.so                                              劆
劆password required       pam_pwcheck.so  nisdir=/etc/yp                            劆
劆password required       pam_unix2.so    nisdir=/etc/yp use_first_pass use_authtok 劆
劆password required       pam_make.so     /var/yp                                   劆
劆session  required       pam_unix2.so                                              劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偙偙偱丄NIS 儅僗僞乕僒乕僶偱 rpasswdd 僨乕儌儞傪婲摦偟傑偡丅

僷僗儚乕僪偺曄峏偼 PAM 儌僕儏乕儖偱峴傢傟傑偡偐傜丄 rpasswdd 偼 NIS+ 傗
LDAP 側偳丄 PAM 儌僕儏乕儖偑僒億乕僩偝傟偰偄傟偽懠偺僒乕價僗偺僷僗儚乕
僪傕曄峏偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

13.2. 僋儔僀傾儞僩偺愝掕 

僋儔僀傾儞僩偱偼丄愝掕僼傽僀儖 /etc/rpasswd.conf 偵僒乕僶偺柤慜傪彂偄偰
偍偔偩偗偱 OK 偱偡丅僒乕僶偑僨僼僅儖僩埲奜偺億乕僩偱摦嶌偟偰偄傞応崌偼
丄偙偙偵偦偺億乕僩傕彂偄偰偍偒傑偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆# rpasswdd runs on master.example.com                               劆
劆server master.example.com                                           劆
劆# Port 774 is the default port                                      劆
劆port 774                                                            劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

14. NIS 偱傛偔偍偙傞栤戣偲偦偺夝寛曽朄  

埲壓偺傛偆側栤戣偑懡偔偺儐乕僓偐傜曬崘偝傟偰偄傑偡丅

 

 1. 僶乕僕儑儞 4.5.19 偺儔僀僽儔儕偼夡傟偰偍傝 NIS 偼摦嶌偟傑偣傫丅 
   
 2. 儔僀僽儔儕傪 4.5.19 偐傜 4.5.24 偵傾僢僾僌儗乕僪偡傞偲 su 僐儅儞僪
    偑巊偊側偔側傝傑偡丅偙偺応崌偼 su 僐儅儞僪傪 Slackware 1.2.0 偐傜擖
    庤偟傑偡丅偮偄偱偵嵟怴偺儔僀僽儔儕傕摫擖偟偰偟傑偆偲椙偄偱偟傚偆丅 
   
 3. NIS 僒乕僶傪嵞婲摦偝偣偨嵺丄ypbind 偑
    劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
    劆yp_match: clnt_call:                                    劆
    劆RPC: Unable to receive; errno = Connection refused      劆
    劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊
    偺傛偆側儊僢僙乕僕傪昞帵偟丄 NIS 偺僨乕僞儀乕僗偵搊榐偝傟偰偄傞恖偑
    儘僌僀儞偱偒側偔側傞偙偲偑偁傝傑偡丅 root 偱儘僌僀儞偟偰 ypbind 傪
    kill 偟丄ypbind 傪婲摦偟側偍偟偰傒偰壓偝偄丅 ypbind 3.3 埲崀偵傾僢
    僾僨乕僩偟偰傕夝寛偱偒傞偲巚偄傑偡丅 
   
 4. libc 傪 5.4.20 埲忋偺斉偵傾僢僾僌儗乕僪偡傞偲丄 YP tools 偑摦嶌偟側
    偔側傝傑偡丅 libc >= 5.4.21 偍傛傃 glibc 2.x 偵偼 yp-tools 1.2 偑昁
    梫偱偡丅偦傟埲慜偺斉偺 libc 偵偼 yp-clients 2.2 偑昁梫偱偡丅
    yp-tools 2.x 側傜偡傋偰偺儔僀僽儔儕偱摦嶌偟傑偡丅 
   
 5. libc 5.4.21-5.4.35 偺 yp_maplist 偼夡傟偰偄傑偡丅 yp-tools 1.x 傪梡
    偄傞偵偼 5.4.36 埲崀偑昁梫偱偡丅偝傕側偄偲 ypwhich 側偳偺 YP 僾儘僌
    儔儉偼 segfault 偟偰偟傑偆偼偢偱偡丅 
   
 6. libc5 偲 trad-NIS 偼 shadow 僷僗儚乕僪偺 NIS 偱偺攝晍傪僒億乕僩偟偰
    偄傑偣傫丅 libc5 + NYS 傑偨偼 glibc 2.x 傪梡偄傞昁梫偑偁傝傑偡丅
   
 7. ypcat 偼 "shadow" 儅僢僾傪昞帵偟傑偣傫丅偙傟偼惓偟偄摦嶌偱偡丅
    shadow 儅僢僾偺柤慜偼 shadow 偱偼側偔丄"shadow.byname" 偱偡偐傜丅
   
 8. Solaris 偼昁偢偟傕摿尃億乕僩傪梡偄傑偣傫丅廬偭偰 Solaris 偺僋儔僀傾
    儞僩偑偁傞応崌偼僷僗儚乕僪 mangling 傪梡偄偰偼偄偗傑偣傫丅
   
 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

15. 傛偔偁傞幙栤 (FAQ) 

偁側偨偑媈栤偵巚偭偰偄偨偙偲偼偙偙傑偱偵戝晹暘偑夝寛偝傟偨偙偲偲巚偄傑
偡偑丄傑偩媈栤揰偑巆偭偰偄傑偟偨傜丄

comp.os.linux.networking

側偳偵幙栤偡傞偲椙偄偲巚偄傑偡丅

栿拲丗擔杮岅偺僯儏乕僗僌儖乕僾偲偟偰偼

fj.os.linux     
japan.comp.linux

側偳偑椙偄偱偟傚偆丅

栿幰偺儁乕僕 (http://surf.ap.seikei.ac.jp/~nakano/linux/NIS-j.html) 偵
偼丄屄恖揑側僀儞僗僩乕儖懱尡婰偑彂偄偰偁傞傎偐丄偙偺暥彂偱徯夘偝傟偰偄
傞僜僼僩僂僃傾擖庤愭偺儈儔乕偺偆偪丄崙撪偺傕偺傪徯夘偟偰偄傑偡丅

