, . , no Internet activity, DNS . - , Sun NIS, . NIS , , passwd . , account . , NIS, hostname /etc/hos . NIS RPC, , client-side , . , NIS , YP, , . , - , Sun . , , YP ypserv, ypbind, .. , NIS Un*ces . - BSD -2 , Sun. GNU Libc , Linux Swen Thmmler. (1) NIS - . Tobias Reber NIS , ; yps. (2) (), NIS, NYS, Peter Eriksson, (3), , plain NIS Sun's much NIS. 1. swen@uni-paderborn.de. NIS yp- linux.tar.gz sunsite.unc.edu / . 2. * ) - yps-0.21 ftp.lysator.liu.se - 177 - /pub/NYS . 3. pen@lysator.liu.se. +. NYS NIS , , , libc . hostname , host.conf. . NYS , " " NIS . , , . , NIS, NFS Hal Stern's NIS (. [GETST " - nfs"]). , NYS - , Linux , NYS . NYS mainstream libc binaries, NYS. , -lnsl libc . libnsl, NYS C. 11.1 NIS NIS , , keyvalue pairs. , NIS , RPC . , DBM. (4) /etc/hosts /etc/passwd. , - 178 - - , . , IP. , NIS , hosts.byname hosts.byaddr, . 11.1 . 4. DBM - , . DBM GNU Gdbm, Linux . ----------------------------------------------------------- +-----------------+---------------------------------------+ |Master File | Map(s) | +-----------------+---------------------------------------+ +-----------------+---------------------------------------+ |/etc/hosts | hosts.byname hosts.byaddr | |/etc/networks | networks.byname networks.byaddr | |/etc/passwd | passwd.byname passwd.byuid | |/etc/group | group.byname group.bygid | |/etc/services | services.byname services.bynumber | |/etc/rpc | rpc.byname rpc.bynumber | |/etc/protocols | protocols.byname protocols.bynumber | |/usr/lib/aliases | mail.aliases | +-----------------+---------------------------------------+ +-----------------+---------------------------------------+ 1. NIS . , NIS . , bootparams , BOOTP , Linux (Ethers.byname ethers.byaddr ). - 179 - , , . NIS , : $ ypcat -x NIS map nickname translation table: "passwd" -> "passwd.byname" "group" -> "group.byname" "networks" -> "networks.byaddr" "hosts" -> "hosts.byname" "protocols" -> "protocols.bynumber" "services" -> "services.byname" "aliases" -> "mail.aliases" "ethers" -> "ethers.byname" "rpc" -> "rpc.bynumber" "netmasks" -> "netmasks.byaddr" "publickey" -> "publickey.byname" "netid" -> "netid.byname" "passwd.adjunct" -> "passwd.adjunct.byname" "group.adjunct" -> "group.adjunct.byname" "timezone" -> "timezone.byname" NIS ypserv. ; , . , , . master server's host. , slaves/ , " " ; NIS, , NIS: NIS - 180 - . , NIS , DNS. , NIS . , . , , NIS . , NIS . , Virtual Brewery NIS , Brewery , brewery winery, . , DNS NIS. NIS , domainname. , NIS ; , : # domainname brewery NIS , NIS - . , Winery , NIS Winery ( , ) ; Brewery host Brewery'. , , , . , , . , , ( , ), . , NIS implementations d NIS NIS . NIS - 181 - , , ypbind . Ypbind , IP ; , NIS. , , , ypbind, . , - , , : ypbind , , NIS "". - NIS. , NYS ypbind , . 11.2 NIS NIS + NIS NIS + . NIS + . NIS , , DNS. , , , NIS + , + . NIS + - . , . . NIS RPC 2, NIS + - - 3. NIS + , , . (, ). , . - 182 - , NIS Sun + ([GETST "nisplus"]). 11.3 NIS , , NIS , C. , passwd , getpwnam (3) getpwuid (3) , . , , /etc/passwd. Nis- , , , RPC , NIS . . " " NIS " " . , , , . NIS , , , . , passwd , kludgy modifications passwd, , , . pitfalls, NYS , . . 11.4 NIS techno-babble, - , . , NIS . NIS - 183 - , ; , . <> Note that if you are just going to experiment with the server, make sure you don't set it up for a NIS domain name that is already in use on your network. This may disrupt the entire network service and make a lot of peo- ple very unhappy, and very angry. NIS , Linux, yps Tobias Reber's, Peter Erikson's ypserv package. , , , NYS NIS , libc . , NIS , , yps. , , yps . (ypserv) /usr/sbkn, , , . NIS brewery domain, /var/yp/brewery. NIS , . NIS , . DBM, . , , makedbm ( Tobias' ) dbmload ( Peter's). . parseable dbmload awk sed, , . , Peter Eriksson's Ypserv . - 184 - , , . Ypserv. , - : all: ethers hosts networks protocols rpc services passwd group netid ethers.byname ethers.byaddr , , . , , , . * . , , "make". . , , , . , NIS . , . -D, NYS , NIS, . , . Tobias' 11.5 NIS NYS , NIS . - NYS NIS , /etc/yp.conf. Winery's : - 185 - # yp.conf - YP configuration for NYS library. # domainname winery server vbardolino NIS , Winery NIS . , NYS , domainname. NIS . , IP vbardolino, ; , IP . , , , NYS NIS . , , NIS , yp.conf. NIS Yp.conf, NIS . , " , : # yp.conf - YP configuration for NYS library. # server vbardolino winery server vstout brewery , NIS . , - - , , , . , , - 186 - hosts.byname, , , ypcat . Ypcat, NIS , /usr/sbin. # ypcat hosts.byname 191.72.2.2 vbeaujolais vbeaujolais.linus.lxnet.org 191.72.2.3 vbardolino vbardolino.linus.lxnet.org 191.72.1.1 vlager vlager.linus.lxnet.org 191.72.2.1 vlager vlager.linus.lxnet.org 191.72.1.2 vstout vstout.linus.lxnet.org 191.72.1.3 vale vale.linus.lxnet.org 191.72.2.4 vchianti vchianti.linus.lxnet.org , , . , "Can't bind to server which serves domain" - , NIS , , yp.conf, - unreachable . , , ping , , rpcinfo, : # rpcinfo -u serverhost ypserv program 100004 version 2 ready and waiting 11.6 , NIS , , NIS . , NIS . , BIND. account NIS ; / 11.7 . , services.byname, , - 187 - , , . , - , NIS . NYS , . /etc/nsswitch.conf, , . , , . . , services.byname ; . , , NIS . Hostname , , , , DNS NIS accoun , DNS NIS . , . , gethostbyname (2), gethostByaddr (2), getservbyname (2) . ; , , . # small sample /etc/nsswitch.conf # hosts: nis dns files services: files nis , Nsswitch.conf . , , , . - 188 - Nisplus nis + NIS + . /etc/nis.conf. Nis NIS . , yp.conf . , Hosts.byname hosts.byaddr . -176 - dns DNS . . , c resolv.conf . files , /etc/hosts . dbm DBM , /var/dbm. , - NIS . , NYS nsswitch.conf : hosts, networks, passwd, group, shadow, gshadow, services, protocols, rpc, . . 11.6 , & nsswitch.conf: [NOTFOUND=return] NYS - , NIS DNS . NYS , NIS DNS - . backup, NIS . 11.7 passwd Maps NIS account NIS . , - 189 - /etc/passwd, site-wide NIS . , NIS nsswitch.conf . , NIS, , , passwd NIS . , NFS . # /etc/nsswitch.conf # hosts: nis dns [NOTFOUND=return] files networks: nis [NOTFOUND=return] files services: files nis protocols: files nis rpc: files nis 17. nsswitch.conf . /etc/passwd /etc/group , maps, ownerships , . uids gids passwd ; , , ownerships. , 9, okir 103, ; : # find / -uid 9 -print >/tmp/uid.9 # find / -uid 103 -print >/tmp/uid.103 # cat /tmp/uid.9 | xargs chown news - 190 - # cat /tmp/uid.103 | xargs chown okir , , passwd , , ownership . , ownerships , . , uid's gid's , NIS . - nsswitch.conf, NIS : # /etc/nsswitch.conf - passwd and group treatment passwd: nis files group: nis files , NIS maps, log in, - . , , root generic accounts . , map uids . , cron job su, , UUCP . uucp passwd, jobs , , &NIS"brownout. : , , , , , , util-linux . NIS . , - , passwd - ls, . - 191 - , ls ; uid gid , NIS , . , - clogged, , , NIS , . . , . , passwd, passwd. NIS, , NIS , , , . , NIS passwd, yppasswd, NIS. , yppasswdd daemon RPC, . , yppasswd , - : # cd /bin # mv passwd passwd.old # ln yppasswd passwd rpc.yppasswdd rc.inet2. NIS . 11.8 NIS Shadow Support NIS , . John F. Haugh, , , GNU GPL comp.sources.misc. - 192 - NIS, , C. , /etc/shadow NIS . NYS shadow.byname map - , NYS /etc/shadow . NYS getpwnam , login , , passwd nsswitch.conf . Nis passwd.byname map NIS . , , , /etc/shadow, , . , root, /etc/passwd. , , NYS shadow. Getpwuid . , binaries, NYS, . 11.9 NIS . , libc, NIS . , ypbind daemon , . , ypbind . NIS , RPC portmapper . ypcat , , (. ). , bug reports, , NIS , : "clntudp create: RPC: portmapper failure - RPC: unable to receive''. - , ypbind . NIS - 193 - , . (5) , NIS , NIS NYS. , NIS , - /etc/passwd map: +: *:0:0::: "" NIS . ( ) /etc/group group. * maps. , hosts.* maps, NIS, order line host.conf . , NIS, DNS, /etc/hosts ( ), : order yp bind hosts NIS . 5. yp-linux ftp.uniaderborn.de /pub/Linux/LOCAL. 12. (NFS) NFS, the network file system, , RPC. , " . kernel ( ) NFS ( ). , . - 194 - NFS : + , , , . , accounts , mount /home . NIS, , . + , . , LaTeX METAFONT . + - . rcp , 20 . Linux NFS - Rick Sladkey, (1), NFS kernel NFS . , unfsd NFS , Mark Shand, hnfs Harris NFS , Donald Becker. , NFS : , . , , , . , mount /home vlager /users vale, vale: (2)  " 1. Rick jrs@world.std.com. # mount -t nfs vlager:/home /users - 195 - mount mountd, daemon vlager RPC. , vale , , file handle. handle /users. - NFS, kernel RPC nfsd (NFS daemon) . handle , , , user's user . . , . Un*x , NFS kernel daemons, . - NFS daemon (nfsd) , - Daemon (biod) . , biod - , - -; , nfsd daemons . NFS Linux, , (VFS) biod. , , - . Linux NFS, - -, Rick Sladkey . (3) Linux NFS - , Linux kernel 1.0 4k; , 3500 .. , NFS daemons , UDP ( 8k SunOS) - 196 - . . (4) Linux-1.1 , , . 2. , -t nfs , mount , NFS . 3. write-behind - , kernel device/inode, nfs- . 12.1 NFS , NFS, , , NFS , . proc , /proc/filesystems, cat: $ cat /proc/filesystems minix ext2 msdos nodev proc nodev nfs nfs , NFS. kernel " Kernel " 4 .. 1.1 Linux,