{"id":25918,"date":"2025-04-19T14:11:09","date_gmt":"2025-04-19T06:11:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/25918.html"},"modified":"2025-04-19T14:11:09","modified_gmt":"2025-04-19T06:11:09","slug":"%e7%ac%ac%e5%8d%81%e5%9b%9b%e7%ab%a0%e3%80%81%e8%b4%a6%e5%8f%b7%e6%8e%a7%e7%ae%a1%ef%bc%9a-nis-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/25918.html","title":{"rendered":"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668"},"content":{"rendered":"<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.1 NIS \u7684\u7531\u6765\u4e0e\u529f\u80fd<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u4e00\u4e2a\u5927\u578b\u7684\u7f51\u57df\u5f53\u4e2d&#xff0c;\u5982\u679c\u6709\u591a\u90e8 Linux \u4e3b\u673a&#xff0c;\u4e07\u4e00\u8981\u6bcf\u90e8\u4e3b\u673a\u90fd\u9700\u8981\u8bbe\u5b9a\u76f8\u540c\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\u65f6&#xff0c;\u4f60\u8be5\u600e\u4e48\u529e&#xff1f;\u590d\u5236 \/etc\/passwd &#xff1f;\u5e94\u8be5\u6ca1\u6709\u8fd9\u4e48\u5446\u5427&#xff1f;\u5982\u679c\u80fd\u591f\u6709\u4e00\u90e8\u8d26\u53f7\u4e3b\u63a7\u670d\u52a1\u5668\u6765\u7ba1\u7406\u7f51\u57df\u4e2d\u6240\u6709\u4e3b\u673a\u7684\u8d26\u53f7&#xff0c; \u5f53\u5176\u4ed6\u7684\u4e3b\u673a\u6709\u7528\u6237\u767b\u5165\u7684\u9700\u6c42\u65f6&#xff0c;\u624d\u5230\u8fd9\u90e8\u4e3b\u63a7\u670d\u52a1\u5668\u4e0a\u9762\u8981\u6c42\u76f8\u5173\u7684\u8d26\u53f7\u3001\u5bc6\u7801\u7b49\u7528\u6237\u4fe1\u606f&#xff0c; \u5982\u6b64\u4e00\u6765&#xff0c;\u5982\u679c\u60f3\u8981\u589e\u52a0\u3001\u4fee\u6539\u3001\u5220\u9664\u7528\u6237\u6570\u636e&#xff0c;\u53ea\u8981\u5230\u8fd9\u90e8\u4e3b\u63a7\u670d\u52a1\u5668\u4e0a\u9762\u5904\u7406\u5373\u53ef&#xff0c; \u8fd9\u6837\u5c31\u80fd\u591f\u964d\u4f4e\u91cd\u590d\u8bbe\u5b9a\u4f7f\u7528\u8005\u8d26\u53f7\u7684\u6b65\u9aa4\u4e86\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u6837\u7684\u529f\u80fd\u6709\u5f88\u591a\u7684\u670d\u52a1\u5668\u8f6f\u4ef6\u53ef\u4ee5\u8fbe\u6210&#xff0c;\u8fd9\u91cc\u6211\u4eec\u8981\u4ecb\u7ecd\u7684\u5219\u662f\u00a0<span style=\"color:#000088\">Network Information Services (NIS server)<\/span>\u00a0\u8fd9\u4e2a\u670d\u52a1\u5668\u8f6f\u4ef6\u5594&#xff01;\u5e95\u4e0b\u5c31\u5148\u6765\u8c08\u4e00\u8c08\u8fd9\u4e2a NIS \u7684\u76f8\u5173\u529f\u80fd\u5427&#xff01;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Tips:<span style=\"color:#009000\">NIS \u4e3b\u8981\u63d0\u4f9b\u7684\u662f\u7528\u6237\u7684\u8d26\u53f7\u3001\u5bc6\u7801\u3001\u5bb6\u76ee\u5f55\u6587\u4ef6\u540d\u3001UID\u7b49\u4fe1\u606f&#xff0c;\u4f46 NIS \u5e76\u6ca1\u6709\u63d0\u4f9b\u6587\u4ef6\u7cfb\u7edf\u3002\u540c\u65f6&#xff0c; NIS \u540c\u6837\u4f7f\u7528\u524d\u4e00\u7ae0\u8c08\u5230\u7684 RPC \u670d\u52a1\u5668&#xff0c;\u56e0\u6b64\u5728\u672c\u7ae0\u5f00\u59cb\u524d&#xff0c;\u4f60\u8fd8\u662f\u5f97\u8981\u8ba4\u8bc6\u4e00\u4e0b\u7b2c\u5341\u4e09\u7ae0\u8c08\u5230\u7684 NFS \u4e0e RPC&#xff0c; \u540c\u65f6\u4f60\u8fd8\u5f97\u8981\u77e5\u9053\u57fa\u7840\u5b66\u4e60\u7bc7\u7b2c\u4e09\u7248\u91cc\u9762\u7684\u7b2c\u5341\u56db\u7ae0\u8d26\u53f7\u7ba1\u7406&#xff0c; \u540c\u65f6\u4e5f\u5f97\u4e86\u89e3\u4e00\u4e0b\u57fa\u7840\u5b66\u4e60\u7bc7\u7b2c\u4e8c\u5341\u4e8c\u7ae0 make\/Makefile\u00a0\u7684\u4fe1\u606f\u624d\u597d\u3002<\/span><\/span><\/span><\/td>\n<td>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u9e1f\u54e5\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061107-68033e7b765bf.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.1.1 NIS \u7684\u4e3b\u8981\u529f\u80fd&#xff1a;\u7ba1\u7406\u5e10\u6237\u4fe1\u606f<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u901a\u5e38\u6211\u4eec\u90fd\u4f1a\u5efa\u8bae&#xff0c;<span style=\"color:#000088\">\u4e00\u90e8 Linux \u4e3b\u673a\u7684\u529f\u80fd\u8d8a\u5355\u7eaf\u8d8a\u597d<\/span>&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u4e00\u90e8 Linux \u5c31\u4e13\u95e8\u8fdb\u884c\u4e00\u9879\u670d\u52a1\u3002\u8fd9\u6837\u6709\u8bb8\u591a\u7684\u597d\u5904&#xff0c;\u8fd9\u5305\u542b\u529f\u80fd\u5355\u7eaf\u6240\u4ee5\u7cfb\u7edf\u8d44\u6e90\u5f97\u4ee5\u5b8c\u6574\u8fd0\u7528&#xff0c; \u5e76\u4e14\u5728\u53d1\u751f\u5165\u4fb5\u6216\u8005\u662f\u7cfb\u7edf\u4ea7\u751f\u72b6\u51b5\u7684\u65f6\u5019&#xff0c;\u4e5f\u6bd4\u8f83\u5bb9\u6613\u8ffd\u67e5\u95ee\u9898\u6240\u5728\u3002\u56e0\u6b64&#xff0c;\u4e00\u4e2a\u516c\u53f8\u5185\u90e8\u5e38\u5e38\u4f1a\u6709\u597d\u51e0\u90e8 Linux \u4e3b\u673a&#xff0c;\u6709\u7684\u4e13\u95e8\u8d1f\u8d23 WWW \u3001\u6709\u7684\u4e13\u95e8\u8d1f\u8d23 Mail \u3001\u6709\u7684\u4e13\u95e8\u8d1f\u8d23 SAMBA \u7b49\u7b49\u7684\u670d\u52a1\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0d\u8fc7&#xff0c;\u8fd9\u6837\u867d\u7136\u6709\u5206\u6563\u98ce\u9669\u3001\u5bb9\u6613\u8ffd\u8e2a\u95ee\u9898\u7684\u597d\u5904&#xff0c;\u4f46\u662f&#xff0c;\u7531\u4e8e\u662f\u540c\u4e00\u4e2a\u516c\u53f8\u5185\u7684\u591a\u90e8\u4e3b\u673a&#xff0c;\u6240\u4ee5\u4e8b\u5b9e\u4e0a\u6240\u6709\u7684 Linux \u4e3b\u673a\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\u90fd\u662f\u4e00\u6837\u7684&#xff01;\u54c7&#xff01;\u90a3\u5982\u679c\u516c\u53f8\u91cc\u9762\u6709 100 \u7684\u4eba\u7684\u8bdd&#xff0c; \u6211\u4eec\u5c31\u9700\u8981\u9488\u5bf9\u8fd9\u4e48\u591a\u90e8\u7684\u4e3b\u673a\u53bb\u8bbe\u5b9a\u8d26\u53f7\u5bc6\u7801\u4e86&#xff01;\u800c\u4e14&#xff0c;\u5982\u679c\u672a\u6765\u8fd8\u6709\u65b0\u8fdb\u5458\u5de5\u7684\u8bdd&#xff0c; \u90a3\u4e48\u5149\u662f\u8bbe\u5b9a\u5bc6\u7801\u5c31\u4f1a\u4f7f\u7cfb\u7edf\u7ba1\u7406\u5458\u6293\u72c2\u4e86&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a\u65f6\u5019&#xff0c;\u8ba9\u6211\u4eec\u6362\u4e00\u4e2a\u89d2\u5ea6\u6765\u601d\u8003&#xff1a;\u5982\u679c\u6211\u8bbe\u8ba1\u4e86\u4e00\u90e8\u4e13\u95e8\u7ba1\u7406\u8d26\u53f7\u4e0e\u5bc6\u7801\u7684\u670d\u52a1\u5668&#xff0c;\u800c\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u5f53\u6709\u5ba2\u6237\u7aef\u8981\u767b\u5165\u7684\u65f6\u5019&#xff0c;\u5c31\u5fc5\u987b\u8981\u5230\u8fd9\u90e8\u7ba1\u7406\u5bc6\u7801\u7684\u670d\u52a1\u5668\u6765\u67e5\u5bfb\u7528\u6237\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801&#xff0c; \u5982\u6b64\u4e00\u6765&#xff0c;\u6211\u8981\u7ba1\u7406\u6240\u6709\u7684 Linux \u4e3b\u673a\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801&#xff0c;\u53ea\u8981\u5230\u90a3\u90e8\u4e3b\u670d\u52a1\u5668\u4e0a\u9762\u53bb\u8fdb\u884c\u8bbe\u5b9a\u5373\u53ef&#xff01; \u5305\u62ec\u65b0\u8fdb\u4eba\u5458\u7684\u8bbe\u5b9a&#xff0c;\u53cd\u6b63\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u90fd\u662f\u5411\u5b83\u67e5\u5bfb\u7684\u561b&#xff01;\u6ca1\u9519&#xff01;\u771f\u662f\u597d&#xff5e;\u8fd9\u4e2a\u5c31\u662f Network Information Service, NIS \u670d\u52a1\u5668\u7684\u4e3b\u8981\u529f\u80fd\u5566&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e8b\u5b9e\u4e0a&#xff0c;<span style=\"color:#000088\">Network Information Service \u6700\u65e9\u5e94\u8be5\u662f\u79f0\u4e3a Sun Yellow Pages (\u7b80\u79f0 yp)<\/span>&#xff0c;\u4e5f\u5c31\u662f Sun \u8fd9\u5bb6\u516c\u53f8\u51fa\u7684\u4e00\u4e2a\u540d\u4e3a Yellow Pages \u7684\u670d\u52a1\u5668\u8f6f\u4ef6&#xff0c;\u8bf7\u6ce8\u610f&#xff0c;\u00a0<span style=\"color:#000088\">NIS \u4e0e YP \u662f\u4e00\u6a21\u4e00\u6837\u7684\u549a\u549a\u5594<\/span>&#xff01;\u8fd9\u4e2a Yellow Pages \u540d\u5b57\u53d6\u7684\u771f\u662f\u597d&#xff01;\u600e\u4e48\u8bf4\u5462&#xff1f;\u77e5\u9053\u9ec4\u9875 (Yellow Pages) \u662f\u4ec0\u4e48\u5417&#xff1f;\u5c31\u662f\u6211\u4eec\u5bb6\u91cc\u7684\u7535\u8bdd\u7c3f\u5566&#xff01; \u4eca\u5929\u5982\u679c\u4f60\u8981\u67e5\u5bfb\u4e00\u5bb6\u5382\u5546\u7684\u7535\u8bdd\u53f7\u7801&#xff0c;\u901a\u5e38\u5c31\u662f\u76f4\u63a5\u53bb\u67e5\u9ec4\u9875\u4e0a\u9762\u7684\u7eaa\u5f55\u6765\u53d6\u5f97\u7535\u8bdd\u53f7\u7801\u554a&#xff01;\u800c\u8fd9\u4e2a NIS \u4e5f\u4e00\u6837&#xff0c;\u5f53\u4f7f\u7528\u8005\u8981\u767b\u5165\u65f6&#xff0c; Linux \u7cfb\u7edf\u5c31\u4f1a\u5230 NIS \u670d\u52a1\u5668\u4e0a\u9762\u53bb\u627e\u5bfb\u8fd9\u4e2a\u4f7f\u7528\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\u4fe1\u606f\u6765\u52a0\u4ee5\u6bd4\u5bf9&#xff0c; \u4ee5\u63d0\u4f9b\u4f7f\u7528\u8005\u767b\u5165\u4e4b\u7528\u7684\u68c0\u9a8c\u554a&#xff01;\u5f88\u68d2\u5427&#xff01; ^_^<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u90a3\u4e48 NIS \u670d\u52a1\u5668\u63d0\u4f9b\u4e86\u54ea\u4e9b\u4fe1\u606f\u5462&#xff1f;\u8fd8\u8bb0\u5f97\u8d26\u53f7\u4e0e\u5bc6\u7801\u653e\u7f6e\u5728\u54ea\u91cc\u5427&#xff1f;NIS \u5c31\u662f\u63d0\u4f9b\u90a3\u4e9b\u6570\u636e\u5566&#xff01; \u4e3b\u8981\u6709\u5e95\u4e0b\u8fd9\u4e9b\u57fa\u672c\u7684\u6570\u636e\u63d0\u4f9b\u7ed9\u6709\u767b\u5165\u9700\u6c42\u7684\u4e3b\u673a\u5594&#xff1a;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u540d<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u6863\u6848\u5185\u5bb9<\/span><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/passwd<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u63d0\u4f9b\u7528\u6237\u8d26\u53f7\u3001UID\u3001GID\u3001\u5bb6\u76ee\u5f55\u6240\u5728\u3001Shell \u7b49\u7b49<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/group<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u63d0\u4f9b\u7fa4\u7ec4\u6570\u636e\u4ee5\u53ca GID \u7684\u5bf9\u5e94&#xff0c;\u8fd8\u6709\u8be5\u7fa4\u7ec4\u7684\u52a0\u5165\u4eba\u5458<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/hosts<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3b\u673a\u540d\u4e0e IP \u7684\u5bf9\u5e94&#xff0c;\u5e38\u7528\u4e8e private IP \u7684\u4e3b\u673a\u540d\u5bf9\u5e94<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/services<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6bcf\u4e00\u79cd\u670d\u52a1 (daemons) \u6240\u5bf9\u5e94\u7684\u57e0\u53e3 (port number)<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/protocols<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u57fa\u7840\u7684 TCP\/IP \u5c01\u5305\u534f\u5b9a&#xff0c;\u5982 TCP, UDP, ICMP \u7b49<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/rpc<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6bcf\u79cd RPC \u670d\u52a1\u5668\u6240\u5bf9\u5e94\u7684\u7a0b\u5e8f\u53f7\u7801<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/var\/yp\/ypservers<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u6570\u636e\u5e93<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81f3\u5c11\u53ef\u4ee5\u63d0\u4f9b\u4e0a\u8ff0\u8fd9\u4e9b\u529f\u80fd&#xff0c;\u5f53\u7136\u5566&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u81ea\u884c\u5b9a\u4e49\u54ea\u4e9b\u6570\u636e\u5e93\u9700\u8981&#xff0c;\u54ea\u4e9b\u6570\u636e\u5e93\u4e0d\u9700\u8981&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.1.2 NIS \u7684\u8fd0\u4f5c\u6d41\u7a0b&#xff1a;\u900f\u8fc7 RPC \u670d\u52a1<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e NIS \u670d\u52a1\u5668\u4e3b\u8981\u662f\u63d0\u4f9b\u7528\u6237\u767b\u5165\u7684\u4fe1\u606f\u7ed9\u5ba2\u6237\u7aef\u4e3b\u673a\u6765\u67e5\u8be2\u4e4b\u7528&#xff0c;\u6240\u4ee5&#xff0c;\u00a0<span style=\"color:#000088\">NIS \u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u6570\u636e\u5f53\u7136\u5c31\u9700\u8981\u7528\u5230\u4f20\u8f93\u4e0e\u8bfb\u5199\u6bd4\u8f83\u5feb\u901f\u7684 &#034;\u6570\u636e\u5e93&#034; \u6587\u4ef6\u7cfb\u7edf&#xff0c; \u800c\u4e0d\u662f\u4f20\u7edf\u7684\u7eaf\u6587\u672c\u6570\u636e<\/span>\u3002\u4e3a\u4e86\u8981\u8fbe\u5230\u8fd9\u4e2a\u76ee\u7684&#xff0c;\u6240\u4ee5\u00a0<span style=\"color:#000088\">NIS \u670d\u52a1\u5668\u5c31\u5fc5\u987b\u8981\u5c06\u524d\u4e00\u5c0f\u8282\u63d0\u5230\u7684\u90a3\u4e9b\u6863\u6848\u5236\u4f5c\u6210\u4e3a\u6570\u636e\u5e93\u6863\u6848<\/span>&#xff0c; \u7136\u540e\u4f7f\u7528\u7f51\u7edc\u534f\u8bae\u8ba9\u5ba2\u6237\u7aef\u4e3b\u673a\u6765\u67e5\u8be2\u5570\u3002\u81f3\u4e8e\u6240\u4f7f\u7528\u7684\u901a\u8baf\u534f\u8bae\u4e0e\u524d\u4e00\u7ae0\u7684\u00a0NFS\u00a0\u76f8\u540c&#xff0c;\u90fd\u4f7f\u7528\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC) \u8fd9\u4e2a\u73a9\u610f\u513f\u5594&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6b64\u5916&#xff0c;\u5982\u679c\u5728\u4e00\u4e2a\u5f88\u5927\u578b\u7684\u7f51\u57df\u91cc\u9762&#xff0c;\u4e07\u4e00\u6240\u6709\u7684 Linux \u4e3b\u673a\u90fd\u5411\u540c\u4e00\u90e8 NIS \u670d\u52a1\u5668\u8981\u6c42\u7528\u6237\u6570\u636e\u65f6&#xff0c; \u8fd9\u90e8 NIS \u670d\u52a1\u5668\u7684\u8d1f\u8f7d (loading) \u53ef\u80fd\u4f1a\u8fc7\u5927\u3002\u751a\u81f3\u5982\u679c\u8003\u8651\u5230\u6570\u636e\u4f7f\u7528\u7684\u98ce\u9669&#xff0c; \u8981\u662f\u8fd9\u5355\u4e00\u7684\u4e00\u90e8 NIS \u670d\u52a1\u5668\u6302\u70b9\u65f6&#xff0c;\u90a3\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u8fd8\u8981\u4e0d\u8981\u8ba9 users \u767b\u5165\u554a&#xff1f; \u6240\u4ee5\u5570&#xff0c;\u5728\u8f83\u4e3a\u5927\u578b\u7684\u4f01\u4e1a\u73af\u5883\u5f53\u4e2d&#xff0c;\u00a0<span style=\"color:#000088\">NIS \u670d\u52a1\u5668\u53ef\u4ee5\u4f7f\u7528 master\/slave (\u4e3b\u63a7\/\u8f85\u52a9\u670d\u52a1\u5668) \u67b6\u6784\u7684<\/span>\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Master NIS \u670d\u52a1\u5668\u63d0\u4f9b\u7cfb\u7edf\u7ba1\u7406\u8005\u5236\u4f5c\u7684\u6570\u636e\u5e93&#xff0c; slave \u5219\u53d6\u5f97\u6765\u81ea master \u7684\u6570\u636e&#xff0c;\u5e76\u85c9\u4ee5\u63d0\u4f9b\u5176\u4ed6\u5ba2\u6237\u7aef\u7684\u67e5\u8be2\u3002 \u5ba2\u6237\u7aef\u53ef\u4ee5\u5411\u6574\u4e2a\u7f51\u57df\u8981\u6c42\u7528\u6237\u8d44\u6599\u7684\u54cd\u5e94&#xff0c;master \u4e0e slave \u7686\u53ef\u56de\u7b54&#xff0c; \u7531\u4e8e slave \u7684\u6570\u636e\u6765\u81ea\u4e8e master &#xff0c;\u6240\u4ee5\u7528\u6237\u8d26\u53f7\u6570\u636e\u672c\u8eab\u662f\u540c\u6b65\u7684&#xff01; \u5982\u6b64\u4e00\u65b9\u9762\u53ef\u4ee5\u5206\u6563 NIS \u670d\u52a1\u5668\u7684\u8d1f\u8f7d&#xff0c;\u800c\u4e14\u4e5f\u53ef\u4ee5\u907f\u514d\u56e0 NIS \u670d\u52a1\u5668\u6302\u70b9\u800c\u5bfc\u81f4\u7684\u65e0\u6cd5\u767b\u5165\u7684\u98ce\u9669\u3002<\/span><\/span><\/p>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 14.1-1\u3001NIS \u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u7684\u8fd0\u4f5c\u4e0e\u67e5\u8be2\u65b9\u5f0f\u793a\u610f\u56fe<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6574\u4e2a NIS \u7684\u8fd0\u4f5c\u5c31\u5982\u540c\u4e0a\u56fe&#xff0c;\u9996\u5148\u5fc5\u987b\u8981\u6709 NIS server \u7684\u5b58\u5728&#xff0c;\u4e4b\u540e\u624d\u4f1a\u6709 NIS Client \u7684\u5b58\u5728\u3002 \u90a3\u4e48\u5f53\u4f7f\u7528\u8005\u6709\u767b\u5165\u7684\u9700\u6c42\u65f6&#xff0c;\u6574\u4e2a NIS \u7684\u8fd0\u4f5c\u7a0b\u5e8f\u662f&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5173\u4e8e NIS Server (master\/slave) \u7684\u8fd0\u4f5c\u7a0b\u5e8f&#xff1a;<\/span><\/span>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS Master \u5148\u5c06\u672c\u8eab\u7684\u8d26\u53f7\u5bc6\u7801\u76f8\u5173\u6863\u6848\u5236\u4f5c\u6210\u4e3a\u6570\u636e\u5e93\u6863\u6848&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS Master \u53ef\u4ee5\u4e3b\u52a8\u7684\u544a\u77e5 NIS slave server \u6765\u66f4\u65b0&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS slave \u4ea6\u53ef\u4e3b\u52a8\u7684\u524d\u5f80 NIS master server \u53d6\u5f97\u66f4\u65b0\u540e\u7684\u6570\u636e\u5e93\u6863\u6848&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u82e5\u6709\u8d26\u53f7\u5bc6\u7801\u7684\u5f02\u52a8\u65f6&#xff0c;\u9700\u8981\u91cd\u65b0\u5236\u4f5c database \u4e0e\u91cd\u65b0\u540c\u6b65\u5316 master\/slave\u3002<\/span><\/span><\/li>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5173\u4e8e\u5f53 NIS Client \u6709\u4efb\u4f55\u767b\u5165\u67e5\u8be2\u7684\u9700\u6c42\u65f6&#xff1a;<\/span><\/span>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS client \u82e5\u6709\u767b\u5165\u9700\u6c42\u65f6&#xff0c;\u4f1a\u5148\u67e5\u8be2\u5176\u672c\u673a\u7684 \/etc\/passwd, \/etc\/shadow \u7b49\u6863\u6848&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u82e5\u5728 NIS Client \u672c\u673a\u627e\u4e0d\u5230\u76f8\u5173\u7684\u8d26\u53f7\u6570\u636e&#xff0c;\u624d\u5f00\u59cb\u5411\u6574\u4e2a NIS \u7f51\u57df\u7684\u4e3b\u673a\u5e7f\u64ad\u67e5\u8be2&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6bcf\u90e8 NIS server (\u4e0d\u8bba master\/slave) \u90fd\u53ef\u4ee5\u54cd\u5e94&#xff0c;\u57fa\u672c\u4e0a\u662f\u300e\u5148\u54cd\u5e94\u8005\u4f18\u5148\u300f\u3002<\/span><\/span><\/li>\n<\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ece\u4e0a\u9762\u7684\u6d41\u7a0b\u5f53\u4e2d&#xff0c;\u4f60\u4f1a\u53d1\u73b0 NIS client \u8fd8\u662f\u4f1a\u5148\u9488\u5bf9\u672c\u673a\u7684\u8d26\u53f7\u6570\u636e\u8fdb\u884c\u67e5\u8be2&#xff0c;\u82e5\u672c\u673a\u67e5\u4e0d\u5230\u65f6\u624d\u5230 NIS server \u4e0a\u5934\u5bfb\u627e\u3002\u56e0\u6b64&#xff0c;\u5982\u679c\u4f60\u7684 NIS client \u672c\u8eab\u5c31\u6709\u5f88\u591a\u4e00\u822c\u4f7f\u7528\u8005\u7684\u8d26\u53f7\u65f6&#xff0c;\u90a3\u8ddf NIS server \u6240\u63d0\u4f9b\u7684\u8d26\u53f7\u5c31\u53ef\u80fd\u4ea7\u751f\u4e00\u5b9a\u7a0b\u5ea6\u7684\u5dee\u5f02\u5570&#xff01;\u6240\u4ee5&#xff0c;\u4e00\u822c\u6765\u8bf4&#xff0c;\u5728\u8fd9\u6837\u7684\u73af\u5883\u4e0b&#xff0c;<span style=\"color:#000088\">NIS client \u6216 NIS slave server \u4f1a\u4e3b\u52a8\u62ff\u6389\u81ea\u5df1\u672c\u673a\u7684\u4e00\u822c\u4f7f\u7528\u8005\u8d26\u53f7&#xff0c;\u4ec5\u4f1a\u4fdd\u7559\u7cfb\u7edf\u6240\u9700\u8981\u7684 root \u53ca\u7cfb\u7edf\u8d26\u53f7\u800c\u5df2\u3002<\/span>\u00a0\u5982\u6b64\u4e00\u6765&#xff0c;\u4e00\u822c\u4f7f\u7528\u8005\u624d\u90fd\u4f1a\u7ecf\u7531 NIS master server \u6240\u63a7\u7ba1\u554a&#xff01; ^_^<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6839\u636e\u4e0a\u9762\u56fe 14.1-1\u00a0\u7684\u8bf4\u660e&#xff0c;\u6211\u4eec\u7684 NIS \u73af\u5883\u5927\u81f4\u4e0a\u9700\u8981\u8bbe\u5b9a\u7684\u57fa\u672c\u7ec4\u4ef6\u5c31\u6709&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS Master server &#xff1a;\u5c06\u6863\u6848\u5efa\u7f6e\u6210\u6570\u636e\u5e93&#xff0c;\u5e76\u63d0\u4f9b slave server \u6765\u66f4\u65b0&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS Slave server &#xff1a;\u4ee5 Master server \u7684\u6570\u636e\u5e93\u4f5c\u4e3a\u672c\u8eab\u7684\u6570\u636e\u5e93\u6765\u6e90&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS client &#xff1a;\u5411 master\/server \u8981\u6c42\u767b\u5165\u8005\u7684\u9a8c\u8bc1\u6570\u636e\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5c31\u5982\u540c\u4e0a\u9762\u63d0\u5230\u7684&#xff0c;\u5728\u5927\u578b\u73af\u5883\u4e2d\u624d\u4f1a\u4f7f\u7528\u5230\u8fd9\u4e48\u590d\u6742\u7684 NIS master\/slave \u67b6\u6784\u3002\u56e0\u6b64&#xff0c;\u672c\u7ae0\u4ec5\u4f1a\u4ecb\u7ecd NIS Master \u7684\u5efa\u7f6e&#xff0c; \u4ee5\u53ca NIS client \u7684\u8bbe\u5b9a\u800c\u5df2\u3002\u5176\u5b9e&#xff0c;NIS \u670d\u52a1\u4f7f\u7528\u7684\u73af\u5883\u5927\u6982\u8d8a\u6765\u8d8a\u4ec5\u5c40\u9650\u5728\u5b66\u672f\u6570\u503c\u6a21\u5f0f\u4eff\u771f\u7684\u4e1b\u96c6\u8ba1\u7b97\u673a\u67b6\u6784\u4e2d (PC cluster)&#xff0c; \u5728\u90a3\u6837\u7684\u67b6\u6784\u4e2d&#xff0c;\u8001\u5b9e\u8bf4&#xff0c;\u9e1f\u54e5\u8ba4\u4e3a\u4ec5\u8981\u5b66\u4f1a NIS master \u5373\u53ef\u3002\u5982\u679c\u8fd8\u6709\u5176\u4ed6\u8d26\u53f7\u65b9\u9762\u7684\u8981\u6c42&#xff0c;\u4f8b\u5982\u8de8\u5e73\u53f0\u7684\u5e10\u6237\u4fe1\u606f\u63d0\u4f9b&#xff0c; \u90a3\u53ef\u80fd\u5c31\u5f97\u8981\u53c2\u8003 Samba \u6216\u66f4\u8fdb\u9636\u7684 LDAP \u624d\u597d\u5466&#xff01;\u8fd9\u91cc\u6211\u4eec\u4e0d\u8c08\u5566&#xff5e;\u73b0\u5728&#xff0c;\u5c31\u8ba9\u6211\u4eec\u5f00\u59cb\u6765\u73a9\u4e00\u73a9\u8fd9\u4e2a NIS \u7684\u8bbe\u5b9a\u5427&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.2 NIS Server \u7aef\u7684\u8bbe\u5b9a<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u670d\u52a1\u5668\u7aef\u4e3b\u8981\u5728\u4e8e\u63d0\u4f9b\u6570\u636e\u5e93\u7ed9\u5ba2\u6237\u7aef\u4f5c\u4e3a\u9a8c\u8bc1\u4e4b\u7528&#xff0c;\u867d\u7136 NIS \u670d\u52a1\u5668\u7c7b\u578b\u6709 Master \u4e0e Slave &#xff0c; \u4e0d\u8fc7\u9e1f\u54e5\u8fd9\u91cc\u4ecb\u7ecd\u7684\u5e76\u4e0d\u662f\u5927\u578b\u4f01\u4e1a\u73af\u5883&#xff0c;\u56e0\u6b64\u4ec5\u4ecb\u7ecd NIS master \u7684\u8bbe\u5b9a\u800c\u5df2\u5566&#xff5e;\u90a3\u5c31\u6765\u8bbe\u5b9a\u770b\u770b\u5570&#xff01;<\/span><\/span> \u00a0<\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.2.1 \u6240\u9700\u8981\u7684\u8f6f\u4ef6<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e NIS \u670d\u52a1\u5668\u9700\u8981\u4f7f\u7528 RPC \u534f\u8bae&#xff0c;\u4e14 NIS \u670d\u52a1\u5668\u540c\u65f6\u4e5f\u53ef\u4ee5\u5f53\u6210\u5ba2\u6237\u7aef&#xff0c;\u56e0\u6b64\u5b83\u9700\u8981\u7684\u8f6f\u4ef6\u5c31\u6709\u5e95\u4e0b\u8fd9\u51e0\u4e2a&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">yp-tools &#xff1a;\u63d0\u4f9b NIS \u76f8\u5173\u7684\u67e5\u5bfb\u6307\u4ee4\u529f\u80fd<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">ypbind \u00a0\u00a0&#xff1a;\u63d0\u4f9b NIS Client \u7aef\u7684\u8bbe\u5b9a\u8f6f\u4ef6<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">ypserv \u00a0\u00a0&#xff1a;\u63d0\u4f9b NIS Server \u7aef\u7684\u8bbe\u5b9a\u8f6f\u4ef6<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rpcbind \u00a0&#xff1a;\u5c31\u662f RPC \u4e00\u5b9a\u9700\u8981\u7684\u6570\u636e\u554a&#xff01;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u4f60\u662f\u4f7f\u7528 Red Hat \u7684\u7cfb\u7edf&#xff0c;\u4f8b\u5982\u6211\u4eec\u7684 CentOS 6.x \u7684\u8bdd&#xff0c;\u90a3\u4f60\u53ef\u4ee5\u5229\u7528\u300e rpm -qa | grep &#039;^yp&#039; \u300f \u6765\u68c0\u67e5\u662f\u5426\u6709\u5b89\u88c5\u4e0a\u8ff0\u7684\u8f6f\u4ef6\u3002\u4e00\u822c\u6765\u8bf4 yp-tools, ypbind \u90fd\u4f1a\u4e3b\u52a8\u7684\u5b89\u88c5&#xff0c;\u4e0d\u8fc7 ypserv \u53ef\u80fd\u5c31\u4e0d\u4f1a\u5b89\u88c5\u4e86\u3002 \u6b64\u65f6\u5efa\u8bae\u4f60\u76f4\u63a5\u4f7f\u7528\u300e\u00a0yum\u00a0install ypserv \u300f\u6765\u5b89\u88c5\u5427&#xff01;\u7acb\u523b\u5c31\u88c5\u597d\u4e86\u3002\u5e95\u4e0b\u7acb\u523b\u6765\u8bbe\u5b9a\u5570&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.2.2 NIS \u670d\u52a1\u5668\u76f8\u5173\u7684\u914d\u7f6e\u6587\u4ef6<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 NIS \u670d\u52a1\u5668\u4e0a\u6700\u91cd\u8981\u7684\u5c31\u662f ypserv \u8fd9\u4e2a\u8f6f\u4ef6\u4e86&#xff0c;\u4f46\u662f&#xff0c;\u7531\u4e8e NIS \u8bbe\u5b9a\u65f6\u8fd8\u4f1a\u4f7f\u7528\u5230\u5176\u4ed6\u7f51\u7edc\u53c2\u6570\u8bbe\u5b9a\u6570\u636e&#xff0c; \u56e0\u6b64\u5728\u914d\u7f6e\u6587\u4ef6\u65b9\u9762\u9700\u8981\u6709\u5e95\u4e0b\u8fd9\u4e9b\u6570\u636e\u5594&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/ypserv.conf<\/span>&#xff1a;\u8fd9\u662f\u6700\u4e3b\u8981\u7684 ypserv \u8f6f\u4ef6\u6240\u63d0\u4f9b\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u89c4\u8303 NIS \u5ba2\u6237\u7aef\u662f\u5426\u53ef\u767b\u5165\u7684\u6743\u9650\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/hosts<\/span>&#xff1a;\u7531\u4e8e NIS server\/client \u4f1a\u7528\u5230\u7f51\u7edc\u4e3b\u673a\u540d\u4e0e IP \u7684\u5bf9\u5e94&#xff0c;\u56e0\u6b64\u8fd9\u4e2a\u4e3b\u673a\u540d\u5bf9\u5e94\u6863\u5c31\u663e\u7684\u76f8\u5f53\u91cd\u8981&#xff01;\u6bcf\u4e00\u90e8\u4e3b\u673a\u540d\u4e0e IP \u90fd\u9700\u8981\u8bb0\u5f55\u624d\u884c&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/sysconfig\/network<\/span>&#xff1a;\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6863\u6848\u5185\u6307\u5b9a NIS \u7684\u7f51\u57df (nisdomainname)\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/var\/yp\/Makefile<\/span>&#xff1a;\u524d\u9762\u4e0d\u662f\u8bf4\u8d26\u53f7\u6570\u636e\u8981\u8f6c\u6210\u6570\u636e\u5e93\u6587\u4ef6\u5417&#xff1f; \u8fd9\u5c31\u662f\u4e0e\u5efa\u7acb\u6570\u636e\u5e93\u6709\u5173\u7684\u52a8\u4f5c\u914d\u7f6e\u6587\u4ef6&#xff1b;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81f3\u4e8e NIS \u670d\u52a1\u5668\u63d0\u4f9b\u7684\u4e3b\u8981\u670d\u52a1\u65b9\u9762\u6709\u5e95\u4e0b\u4e24\u4e2a&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/usr\/sbin\/ypserv<\/span>&#xff1a;\u5c31\u662f NIS \u670d\u52a1\u5668\u7684\u4e3b\u8981\u63d0\u4f9b\u670d\u52a1&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/usr\/sbin\/rpc.yppasswdd<\/span>&#xff1a;\u63d0\u4f9b\u989d\u5916\u7684 NIS \u5ba2\u6237\u7aef\u4e4b\u7528\u6237\u5bc6\u7801\u4fee\u6539\u670d\u52a1&#xff0c; \u900f\u8fc7\u8fd9\u4e2a\u670d\u52a1&#xff0c; NIS \u5ba2\u6237\u7aef\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u5728 NIS \u670d\u52a1\u5668\u4e0a\u7684\u5bc6\u7801\u3002\u76f8\u5173\u7684\u4f7f\u7528\u7a0b\u5e8f\u5219\u662f yppasswd \u6307\u4ee4&#xff1b;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0e\u8d26\u53f7\u5bc6\u7801\u7684\u6570\u636e\u5e93\u6709\u5173\u7684\u6307\u4ee4\u65b9\u9762\u6709\u5e95\u4e0b\u51e0\u4e2a&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/usr\/lib64\/yp\/ypinit<\/span>&#xff1a;\u5efa\u7acb\u6570\u636e\u5e93\u7684\u6307\u4ee4&#xff0c;\u975e\u5e38\u5e38\u7528 (\u5728 32 \u4f4d\u7684\u7cfb\u7edf\u4e0b&#xff0c;\u6587\u4ef6\u540d\u5219\u662f \/usr\/lib\/yp\/ypinit \u5594&#xff01;)&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/usr\/bin\/yppasswd<\/span>&#xff1a;\u4e0e NIS \u5ba2\u6237\u7aef\u6709\u5173&#xff0c;\u4e3b\u8981\u5728\u8ba9\u7528\u6237\u4fee\u6539\u670d\u52a1\u5668\u4e0a\u7684\u5bc6\u7801\u3002<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.2.3 \u4e00\u4e2a\u5b9e\u4f5c\u6848\u4f8b<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u4f60\u6709\u89c2\u5bdf\u8fc7\u56fe 14.1-1\u00a0\u7684\u8bdd&#xff0c;\u4f60\u4f1a\u53d1\u73b0\u5230\u6211\u4eec\u7684 NIS \u9700\u8981\u8bbe\u5b9a Master\/Slave \u53ca client \u7b49&#xff0c; \u4e0d\u8fc7\u6211\u4eec\u8fd9\u91cc\u4ec5\u4ecb\u7ecd NIS master server \u4e0e NIS client \u4e24\u4e2a\u7ec4\u4ef6\u800c\u5df2&#xff0c;\u5982\u679c\u4f60\u6709\u9700\u8981\u989d\u5916\u7684 slave \u7684\u8bdd&#xff0c; \u518d\u8bf7\u67e5\u9605 NIS \u5b98\u7f51\u7684\u4ecb\u7ecd\u5570\u3002\u5e95\u4e0b\u9e1f\u54e5\u5148\u62df\u4e00\u4e2a\u7b80\u5355\u7684\u6848\u4f8b&#xff0c;\u505a\u5b8c\u6848\u4f8b\u6211\u4eec\u518d\u6765\u8c08\u8c08\u5b9e\u9645\u53ef\u80fd\u4f1a\u4f7f\u7528\u4e8e\u4e1b\u96c6\u8ba1\u7b97\u673a\u7684\u6848\u4f8b\u5427&#xff01;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u7684\u57df\u540d\u4e3a vbirdnis<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6574\u4e2a\u5185\u90e8\u7684\u4fe1\u4efb\u7f51\u57df\u4e3a 192.168.100.0\/24<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS master server \u7684 IP \u4e3a 192.168.100.254 &#xff0c;\u4e3b\u673a\u540d\u4e3a www.centos.vbird<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS client \u7684 IP \u4e3a 192.168.100.10&#xff0c;\u4e3b\u673a\u540d\u4e3a clientlinux.centos.vbird<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5e95\u4e0b\u6211\u4eec\u5c31\u4e00\u4e2a\u4e00\u4e2a\u6765\u8bbe\u5b9a\u5427&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.2.4 NIS server \u7684\u8bbe\u5b9a\u4e0e\u542f\u52a8<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u670d\u52a1\u5668\u7684\u8bbe\u5b9a\u771f\u662f\u5f88\u7b80\u5355&#xff0c;\u9996\u5148&#xff0c;\u4f60\u5fc5\u987b\u8981\u5728 NIS \u670d\u52a1\u5668\u4e0a\u9762\u641e\u5b9a\u4f60\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\u76f8\u5173\u6570\u636e&#xff0c; \u8fd9\u5305\u62ec \/etc\/passwd, \/etc\/shadow, \/etc\/hosts, \/etc\/group &#8230;. \u7b49\u7b49&#xff0c;\u90fd\u5f97\u8981\u5148\u641e\u5b9a\u624d\u884c&#xff01; \u8be6\u7ec6\u7684\u8d26\u53f7\u76f8\u5173\u8d44\u6599\u8bf7\u53c2\u8003\u57fa\u7840\u7bc7\u7684\u7b2c\u5341\u56db\u7ae0\u8d26\u53f7\u7ba1\u7406\u3002 \u7b49\u5230\u641e\u5b9a\u4e4b\u540e\u4f60\u5c31\u53ef\u4ee5\u7ee7\u7eed NIS \u670d\u52a1\u5668\u7684\u8bbe\u5b9a\u4e86&#xff1a;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">1. \u5148\u8bbe\u5b9a NIS \u7684\u57df\u540d (NIS domain name)<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u662f\u4f1a\u5206\u9886\u57df\u540d (domain name) \u6765\u5206\u8fa8\u4e0d\u540c\u7684\u8d26\u53f7\u5bc6\u7801\u6570\u636e\u7684&#xff0c;\u56e0\u6b64\u4f60\u5fc5\u987b\u8981\u5728\u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u90fd\u6307\u5b9a\u76f8\u540c\u7684 NIS \u9886\u57df\u540d\u624d\u884c\u3002\u8bbe\u5b9a\u8fd9\u4e2a NIS \u9886\u57df\u540d\u7684\u52a8\u4f5c\u5f88\u7b80\u5355&#xff0c;\u5c31\u76f4\u63a5\u7f16\u8f91 \/etc\/sysconfig\/network \u5373\u53ef&#xff01;\u5982\u4e0b\u6240\u793a&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/sysconfig\/network<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4e0d\u8981\u66f4\u6539\u5176\u4ed6\u65e2\u6709\u6570\u636e&#xff0c;\u53ea\u8981\u52a0\u5165\u5e95\u4e0b\u8fd9\u51e0\u884c\u5373\u53ef&#xff1a;<\/span><br \/>\n<span style=\"color:#FFFF00\">NISDOMAIN&#061;vbirdnis      <span style=\"color:#777777\">&lt;&#061;&#061;\u8bbe\u5b9a NIS \u9886\u57df\u540d<\/span><br \/>\nYPSERV_ARGS&#061;&#034;-p 1011&#034;   <span style=\"color:#777777\">&lt;&#061;&#061;\u8bbe\u5b9a NIS \u6bcf\u6b21\u90fd\u542f\u52a8\u5728\u56fa\u5b9a\u7684\u57e0\u53e3<\/span><\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u7136&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u624b\u52a8\u7684\u65b9\u5f0f\u6682\u65f6\u8bbe\u5b9a\u597d\u4f60\u7684 NIS \u9886\u57df\u540d&#xff0c;\u900f\u8fc7\u7684\u65b9\u6cd5\u5c31\u662f nisdomainname \u8fd9\u4e2a\u6307\u4ee4\u3002 (\u5176\u5b9e nisdomainname \u4e0e ypdomainname \u53ca domainname \u90fd\u662f\u4e00\u6a21\u4e00\u6837\u7684\u6307\u4ee4\u5566&#xff01;\u4f60\u53ea\u8981\u8bb0\u4f4f\u4e00\u4e2a\u6307\u4ee4\u540d\u79f0\u5373\u53ef\u3002\u8bf7\u81ea\u884c man domainname \u5427&#xff01;)\u4e0d\u8fc7&#xff0c;\u8fd9\u4e2a\u6307\u4ee4\u73b0\u5728\u5927\u6982\u53ea\u7528\u6765\u68c0\u67e5\u8bbe\u5b9a\u662f\u5426\u6b63\u786e&#xff0c;\u56e0\u4e3a\u542f\u52a8 NIS \u670d\u52a1\u5668\u65f6&#xff0c;\u670d\u52a1\u5668\u53bb\u6349\u53d6\u7684\u6570\u636e\u5c31\u662f\u4ece network \u8fd9\u4e2a\u6863\u6848\u91cc\u9762\u6349\u53d6\u7684&#xff01;\u6240\u4ee5\u53ea\u8981\u6539\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u5373\u53ef\u554a&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53e6\u5916&#xff0c;\u7531\u4e8e\u672a\u6765\u60f3\u4f7f\u7528 iptables \u76f4\u63a5\u7ba1\u7406 NIS \u7684\u4f7f\u7528&#xff0c;\u56e0\u6b64\u6211\u4eec\u60f3\u8981\u63a7\u5236 NIS \u542f\u52a8\u5728\u56fa\u5b9a\u7684\u57e0\u53e3\u4e0a\u3002\u6b64\u65f6&#xff0c; \u5c31\u4f7f\u7528\u300eYPSERV_ARGS&#061;&#034;-p 1011&#034;\u300f\u8fd9\u4e2a\u8bbe\u5b9a\u503c\u6765\u56fa\u5b9a\u57e0\u53e3\u5728 1011 \u5427&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">2. \u4e3b\u8981\u914d\u7f6e\u6587\u4ef6 \/etc\/ypserv.conf<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u5c31\u662f NIS \u670d\u52a1\u5668\u6700\u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u5566&#xff01;\u5185\u5bb9\u5176\u5b9e\u5f88\u7b80\u5355&#xff0c;\u4f60\u53ef\u4ee5\u4fdd\u7559\u9ed8\u8ba4\u503c\u5373\u53ef\u3002\u4e0d\u8fc7&#xff0c;\u4e5f\u53ef\u4ee5\u4f5c\u4e00\u4e9b\u66f4\u52a8\u5566&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/ypserv.conf<\/span><br \/>\n<span style=\"color:#FFFF00\">dns: no<\/span><br \/>\n<span style=\"color:#ff6666\"># NIS \u670d\u52a1\u5668\u5927\u591a\u4f7f\u7528\u4e8e\u5185\u90e8\u5c40\u57df\u7f51\u7edc&#xff0c;\u53ea\u8981\u6709 \/etc\/hosts \u5373\u53ef&#xff0c;\u4e0d\u7528 DNS \u5566<\/span><\/p>\n<p><span style=\"color:#FFFF00\">files: 30<\/span><br \/>\n<span style=\"color:#ff6666\"># \u9884\u8bbe\u4f1a\u6709 30 \u4e2a\u6570\u636e\u5e93\u88ab\u8bfb\u5165\u5185\u5b58\u5f53\u4e2d&#xff0c;\u5176\u5b9e\u6211\u4eec\u7684\u8d26\u53f7\u6863\u6848\u5e76\u4e0d\u591a&#xff0c;30 \u4e2a\u591f\u7528\u4e86\u3002<\/span><\/p>\n<p><span style=\"color:#FFFF00\">xfr_check_port: yes<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4e0e master\/slave \u6709\u5173&#xff0c;\u5c06\u540c\u6b65\u66f4\u65b0\u7684\u6570\u636e\u5e93\u6bd4\u5bf9\u6240\u4f7f\u7528\u7684\u7aef\u53e3&#xff0c;\u653e\u7f6e\u4e8e &lt;1024 \u5185\u3002<\/span><\/p>\n<p><span style=\"color:#ff6666\"># \u5e95\u4e0b\u5219\u662f\u8bbe\u5b9a\u9650\u5236\u5ba2\u6237\u7aef\u6216 slave server \u67e5\u8be2\u7684\u6743\u9650&#xff0c;\u5229\u7528\u5192\u53f7\u9694\u6210\u56db\u90e8\u5206&#xff1a;<br \/>\n# [\u4e3b\u673a\u540d\/IP] : [NIS\u57df\u540d] : [\u53ef\u7528\u6570\u636e\u5e93\u540d\u79f0] : [\u5b89\u5168\u9650\u5236]<br \/>\n# [\u4e3b\u673a\u540d\/IP]   &#xff1a;\u53ef\u4ee5\u4f7f\u7528 network\/netmask \u5982 192.168.100.0\/255.255.255.0<br \/>\n# [NIS\u57df\u540d]   &#xff1a;\u4f8b\u5982\u672c\u6848\u4f8b\u4e2d\u7684 vbirdnis<br \/>\n# [\u53ef\u7528\u6570\u636e\u5e93\u540d\u79f0]&#xff1a;\u5c31\u662f\u7531 NIS \u5236\u4f5c\u51fa\u6765\u7684\u6570\u636e\u5e93\u540d\u79f0&#xff1b;<br \/>\n# [\u5b89\u5168\u9650\u5236]      &#xff1a;\u5305\u62ec\u6ca1\u6709\u9650\u5236 (none)\u3001\u4ec5\u80fd\u4f7f\u7528 &lt;1024 (port) \u53ca\u62d2\u7edd (deny)<br \/>\n# \u4e00\u822c\u6765\u8bf4&#xff0c;\u4f60\u53ef\u4ee5\u4f9d\u7167\u6211\u4eec\u7684\u7f51\u57df\u6765\u8bbe\u5b9a\u6210\u4e3a\u5e95\u4e0b\u7684\u6a21\u6837&#xff1a;<\/span><br \/>\n<span style=\"color:#FFFF00\">127.0.0.0\/255.255.255.0     : * : * : none<\/span><br \/>\n<span style=\"color:#FFFF00\">192.168.100.0\/255.255.255.0 : * : * : none<\/span><br \/>\n<span style=\"color:#FFFF00\">*                           : * : * : deny<\/span><br \/>\n<span style=\"color:#ff6666\"># \u661f\u53f7 (*) \u4ee3\u8868\u4efb\u4f55\u6570\u636e\u90fd\u63a5\u53d7\u7684\u610f\u601d\u3002\u4e0a\u9762\u4e09\u884c\u7684\u610f\u601d\u662f&#xff0c;\u5f00\u653e lo \u5185\u90e8\u63a5\u53e3\u3001<br \/>\n# \u5f00\u653e\u5185\u90e8 LAN \u7f51\u57df&#xff0c;\u4e14\u675c\u7edd\u6240\u6709\u5176\u4ed6\u6765\u6e90\u7684 NIS \u8981\u6c42\u7684\u610f\u601d\u3002<\/span><\/p>\n<p><span style=\"color:#ff6666\"># \u8fd8\u6709\u4e00\u4e2a\u7b80\u5355\u4f5c\u6cd5&#xff0c;\u4f60\u53ef\u4ee5\u5148\u5c06\u4e0a\u9762\u4e09\u884c\u6279\u6ce8&#xff0c;\u7136\u540e\u52a0\u5165\u5e95\u4e0b\u8fd9\u4e00\u884c\u5373\u53ef&#xff1a;<\/span><br \/>\n<span style=\"color:#FFFF00\">*                         : * : * : none<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e\u9e1f\u54e5\u4e60\u60ef\u5728\u5185\u90e8\u7f51\u57df\u5e76\u4e0d\u8bbe\u5b9a\u6bd4\u8f83\u4e25\u683c\u7684\u9650\u5236&#xff0c;\u56e0\u6b64\u901a\u5e38\u9e1f\u54e5\u90fd\u662f\u9009\u62e9\u4f7f\u7528\u300e * : * : * : none \u300f\u90a3\u4e2a\u8bbe\u5b9a\u503c&#xff01; \u7136\u540e\u900f\u8fc7 iptables \u6765\u7ba1\u63a7\u53ef\u4f7f\u7528\u7684\u6765\u6e90\u5c31\u662f\u4e86\u3002\u5f53\u7136&#xff0c;\u4f60\u53ef\u4ee5\u4f9d\u636e\u4f60\u7684\u9700\u6c42\u6765\u8bbe\u5b9a\u5566&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">3. \u8bbe\u5b9a\u4e3b\u673a\u540d\u4e0e IP \u7684\u5bf9\u5e94 (\/etc\/hosts)<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 \/etc\/ypserv.conf \u7684\u8bbe\u5b9a\u5f53\u4e2d\u6211\u4eec\u8c08\u5230 NIS \u5927\u90e8\u5206\u662f\u7ed9\u5c40\u57df\u7f51\u7edc\u5185\u7684\u4e3b\u673a\u4f7f\u7528\u7684&#xff0c;\u6240\u4ee5\u5f53\u7136\u5c31\u4e0d\u9700\u8981 DNS \u7684\u8bbe\u5b9a\u4e86\u3002\u4e0d\u8fc7&#xff0c;\u7531\u4e8e NIS \u4f7f\u7528\u5230\u5f88\u591a\u7684\u4e3b\u673a\u540d&#xff0c;\u4f46\u662f\u7f51\u7edc\u8054\u673a\u900f\u8fc7\u7684\u662f IP \u554a&#xff01;<span style=\"color:#000088\">\u6240\u4ee5\u4f60\u4e00\u5b9a\u8981\u8bbe\u5b9a\u597d \/etc\/hosts \u91cc\u9762\u7684\u4e3b\u673a\u540d\u4e0e IP \u7684\u5bf9\u5e94&#xff0c;\u5426\u5219\u4f1a\u65e0\u6cd5\u6210\u529f\u8054\u673a NIS &#xff01;<\/span>\u8fd9\u4e2a\u5f88\u91cd\u8981&#xff0c;\u7edd\u5927\u90e8\u5206\u7684\u670b\u53cb\u65e0\u6cd5\u8fbe\u6210 NIS server\/client \u7684\u8054\u673a\u90fd\u662f\u8fd9\u91cc\u51fa\u95ee\u9898\u800c\u5df2\u3002 \u4f9d\u636e\u672c\u6848\u4f8b\u7684\u8bbe\u5b9a\u503c&#xff0c;\u4f60\u5e94\u8be5\u8fd9\u6837\u505a&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/hosts<\/span><br \/>\n<span style=\"color:#ff6666\"># \u539f\u672c\u5c31\u6709\u7684 localhost \u4e0e 127.0.0.1 \u4e4b\u7c7b\u7684\u8bbe\u5b9a\u90fd\u4e0d\u8981\u66f4\u52a8&#xff0c;\u53ea\u8981\u65b0\u589e\u6570\u636e&#xff1a;<\/span><br \/>\n<span style=\"color:#FFFF00\">192.168.100.254   www.centos.vbird<br \/>\n192.168.100.10    clientlinux.centos.vbird<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">hostname<\/span><br \/>\nwww.centos.vbird<br \/>\n<span style=\"color:#ff6666\"># \u518d\u505a\u4e2a\u786e\u8ba4&#xff0c;\u786e\u5b9a\u8f93\u51fa\u7684\u4e3b\u673a\u540d\u4e0e\u672c\u673a IP \u786e\u5b9e\u6709\u5199\u5165 \/etc\/hosts \u5594&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6ce8\u610f&#xff01;\u5982\u679c\u4f60\u7684\u4e3b\u673a\u540d (hostname) \u4e0e NIS \u7684\u4e3b\u673a\u540d\u4e0d\u4e00\u6837&#xff0c;\u90a3\u4e48\u5728\u8fd9\u4e2a\u6863\u6848\u5f53\u4e2d\u8fd8\u662f\u9700\u8981\u5c06\u4f60\u7684\u4e3b\u673a\u540d\u7ed9\u4ed6\u8bbe\u5b9a\u8fdb\u6765&#xff01; \u5426\u5219\u5728\u540e\u9762\u6570\u636e\u5e93\u7684\u8bbe\u5b9a\u65f6&#xff0c;\u80af\u5b9a\u4f1a\u53d1\u751f\u95ee\u9898\u3002\u5f53\u7136\u5566&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5728 \/etc\/sysconfig\/network \u5f53\u4e2d\u76f4\u63a5\u91cd\u65b0\u8bbe\u5b9a\u4e3b\u673a\u540d&#xff0c;\u7136\u540e\u91cd\u65b0\u542f\u52a8&#xff0c;\u6216\u8005\u662f\u5229\u7528 hostname \u8fd9\u4e2a\u6307\u4ee4\u91cd\u65b0\u8bbe\u5b9a\u4f60\u7684\u4e3b\u673a\u540d\u4e5f\u53ef\u4ee5\u3002<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">4. \u542f\u52a8\u4e0e\u89c2\u5bdf\u6240\u6709\u76f8\u5173\u7684\u670d\u52a1<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u63a5\u4e0b\u6765\u5f53\u7136\u662f\u5148\u542f\u52a8\u6240\u6709\u76f8\u5173\u7684\u670d\u52a1\u5570&#xff0c;\u8fd9\u5305\u62ec RPC, ypserv \u4ee5\u53ca yppasswdd \u5570&#xff01;\u4e0d\u8fc7&#xff0c;\u5982\u679c\u4f60\u7684 RPC \u672c\u6765\u5c31\u5df2\u7ecf\u542f\u52a8\u7684\u8bdd&#xff0c;\u90a3\u5c31\u4e0d\u8981\u91cd\u65b0\u542f\u52a8 rpcbind \u4e86&#xff01;\u6b64\u5916&#xff0c;\u4e3a\u4e86\u4e5f\u8ba9 yppasswdd \u542f\u52a8\u5728\u56fa\u5b9a\u7684\u57e0\u53e3&#xff0c;\u65b9\u4fbf\u9632\u706b\u5899\u7684\u7ba1\u7406&#xff0c; \u56e0\u6b64&#xff0c;\u6211\u4eec\u4e5f\u5efa\u8bae\u4f60\u53ef\u4ee5\u8bbe\u5b9a\u4e00\u4e0b \/etc\/sysconfig\/yppasswdd \u5594&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/sysconfig\/yppasswdd<\/span><br \/>\n<span style=\"color:#FFFF00\">YPPASSWDD_ARGS&#061;&#034;&#8211;port  1012&#034;<\/span>    <span style=\"color:#777777\">&lt;&#061;&#061;\u627e\u5230\u8fd9\u4e2a\u8bbe\u5b9a\u503c&#xff0c;\u4fee\u6539\u4e00\u4e0b\u5185\u5bb9\u6210\u8fd9\u6837&#xff01;<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/ypserv start<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/yppasswdd start<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chkconfig ypserv on<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chkconfig yppasswdd on<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6ce8\u610f&#xff0c;\u4e3b\u8981\u7684 NIS \u670d\u52a1\u662f ypserv &#xff0c;\u4e0d\u8fc7&#xff0c;\u5982\u679c\u8981\u63d0\u4f9b NIS \u5ba2\u6237\u7aef\u7684\u5bc6\u7801\u4fee\u6539\u529f\u80fd\u7684\u8bdd&#xff0c; \u6700\u597d\u8fd8\u662f\u5f97\u8981\u542f\u52a8 yppasswdd \u8fd9\u4e2a\u670d\u52a1\u624d\u597d\u3002\u5728\u542f\u52a8\u5b8c\u6bd5\u540e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5229\u7528 rpcinfo \u6765\u68c0\u67e5\u770b\u770b&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">rpcinfo -p localhost<\/span><br \/>\n   program vers proto   port  service<br \/>\n    100000    4   tcp    111  portmapper<br \/>\n    100000    4   udp    111  portmapper<br \/>\n    100004    2   udp   1011  ypserv<br \/>\n    100004    1   udp   1011  ypserv<br \/>\n    100004    2   tcp   1011  ypserv<br \/>\n    100004    1   tcp   1011  ypserv<br \/>\n    100009    1   udp   1012  yppasswdd<br \/>\n<span style=\"color:#ff6666\"># \u5176\u4ed6\u4e0d\u76f8\u5e72\u7684 RPC \u9e1f\u54e5\u5c06\u5b83\u62ff\u6389\u4e86&#xff0c;\u4e0e NIS \u6709\u5173\u7684\u81f3\u5c11\u8981\u6709\u4e0a\u9762\u8fd9\u51e0\u4e2a&#xff01;\u8981\u4ed4\u7ec6\u770b&#xff0c;<br \/>\n# \u770b\u770b\u57e0\u53e3\u662f\u5426\u4e3a\u6211\u4eec\u89c4\u5b9a\u7684 1011, 1012 &#xff0c;\u82e5\u4e0d\u662f\u7684\u8bdd&#xff0c;\u5f97\u8981\u4fee\u6539\u4e00\u4e0b\u914d\u7f6e\u6587\u4ef6\u3002<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">rpcinfo -u localhost ypserv<\/span><br \/>\nprogram 100004 version 1 ready and waiting<br \/>\nprogram 100004 version 2 ready and waiting<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f88\u591a\u65f6\u5019&#xff0c;\u5f88\u591a\u670b\u53cb\u5728\u8bbe\u5b9a\u5b8c NIS \u540e\u53c8\u56de\u53bb\u8bbe\u5b9a NFS \u4e86&#xff0c;\u7ed3\u679c\u770b\u4e86\u524d\u4e00\u7ae0\u7684\u4ecb\u7ecd&#xff0c;\u7adf\u7136\u53c8\u91cd\u65b0\u542f\u52a8 rpcbind &#xff0c; \u8fd9\u5c06\u5bfc\u81f4 ypserv \u7684\u6ce8\u518c\u6570\u636e\u88ab\u6ce8\u9500\u6389\u3002\u56e0\u6b64&#xff0c;\u4f7f\u7528\u4e0a\u8ff0\u7684\u52a8\u4f5c\u6765\u68c0\u67e5\u770b\u770b\u670d\u52a1\u6709\u6ca1\u6709\u5728\u7b49\u5f85\u4e2d&#xff0c; \u8981\u770b\u5230\u5982\u4e0a\u7684\u300e\u5c31\u7eea\u5e76\u7b49\u5f85\u670d\u52a1\u300f\u624d\u4f1a\u662f\u6b63\u5e38\u7684\u5466&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">5. \u5904\u7406\u8d26\u53f7\u5e76\u5efa\u7acb\u6570\u636e\u5e93<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u5b8c\u6210\u4e86\u4e0a\u9762\u7684\u6240\u6709\u6b65\u9aa4\u540e&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u5f97\u8981\u5f00\u59cb\u5c06\u4e3b\u673a\u4e0a\u9762\u7684\u8d26\u53f7\u6863\u6848\u8f6c\u6210\u6570\u636e\u5e93\u6863\u6848\u5566&#xff01; \u4e0d\u8fc7&#xff0c;\u56e0\u4e3a\u62c5\u5fc3\u4e0e NIS \u5ba2\u6237\u7aef\u7684\u8d26\u53f7\u6709\u51b2\u7a81&#xff0c;\u52a0\u4e0a\u4e4b\u524d\u6211\u4eec\u5df2\u7ecf\u5efa\u7acb\u8fc7\u4e00\u4e9b\u8d26\u53f7\u4e86\u3002\u6240\u4ee5&#xff0c;\u8fd9\u91cc\u6211\u4eec\u5efa\u7acb\u4e09\u4e2a\u65b0\u8d26\u53f7&#xff0c; \u5206\u522b\u662f nisuser1, nisuser2, nisuser3 \u3002\u4e0d\u8fc7\u8d26\u53f7\u4e3b\u8981\u662f\u4f9d\u636e UID \u6765\u5224\u65ad\u7684\u554a&#xff01;\u56e0\u6b64&#xff0c;\u6211\u4eec\u4f7f\u7528\u5927\u4e8e 1000 \u7684 UID \u6765\u5efa\u7acb\u8fd9\u4e09\u4e2a\u8d26\u53f7\u5594&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 1001 nisuser1<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 1002 nisuser2<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 1003 nisuser3<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin nisuser1<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin nisuser2<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin nisuser3<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u63a5\u4e0b\u6765&#xff0c;\u5c06\u5efa\u7acb\u7684\u5e10\u5bc6\u6570\u636e\u8f6c\u6210\u6570\u636e\u5e93\u5427&#xff01;\u8f6c\u6362\u7684\u52a8\u4f5c\u76f4\u63a5\u900f\u8fc7 \/usr\/lib64\/yp\/ypinit \u8fd9\u4e2a\u6307\u4ee4\u6765\u5904\u7406\u5373\u53ef&#xff01;\u6574\u4e2a\u6b65\u9aa4\u662f\u8fd9\u6837\u505a\u7684&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">\/usr\/lib64\/yp\/ypinit -m<\/span><\/p>\n<p>At this point, we have to construct a list of the hosts which will run NIS<br \/>\nservers.  www.centos.vbird is in the list of NIS server hosts.  Please continue<br \/>\nto add the names for the other hosts, one per line.  When you are done with the<br \/>\nlist, type a &lt;control D&gt;.<br \/>\n        next host to add:  www.centos.vbird  <span style=\"color:#777777\">&lt;&#061;&#061;\u7cfb\u7edf\u6839\u636e\u4e3b\u673a\u540d\u81ea\u52a8\u6349\u53d6<\/span><br \/>\n        next host to add:                    <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u4e2a\u5730\u65b9\u6309\u4e0b [crtl]-d<\/span><br \/>\nThe current list of NIS servers looks like this:<\/p>\n<p>www.centos.vbird<\/p>\n<p>Is this correct?  [y\/n: y]  <span style=\"color:#FFFF00\">y<\/span><br \/>\nWe need a few minutes to build the databases&#8230;<br \/>\nBuilding <span style=\"color:#FFFF00\">\/var\/yp\/vbirdnis\/ypservers<\/span>&#8230;<br \/>\nRunning \/var\/yp\/Makefile&#8230;<br \/>\ngmake[1]: Entering directory &#096;\/var\/yp\/vbirdnis&#039;<br \/>\nUpdating passwd.byname&#8230;<br \/>\nUpdating passwd.byuid&#8230;<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><br \/>\ngmake[1]: Leaving directory &#096;\/var\/yp\/vbirdnis&#039;<\/p>\n<p>www.centos.vbird has been set up as a NIS master server.<\/p>\n<p>Now you can run ypinit -s www.centos.vbird on all slave server.<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8981\u6ce8\u610f\u51fa\u73b0\u7684\u4fe1\u606f\u5f53\u4e2d&#xff0c;\u5728\u544a\u77e5\u4f60\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165 [ctrl]-d \u4ee5\u7ed3\u675f\u7684\u90a3\u4e2a\u5730\u65b9&#xff0c; \u4f60\u7684\u4e3b\u673a\u540d\u4f1a\u4e3b\u52a8\u7684\u88ab\u6349\u51fa\u6765&#xff0c;\u6ce8\u610f&#xff01;\u8fd9\u4e2a\u4e3b\u673a\u540d\u52a1\u5fc5\u9700\u8981\u5728 \/etc\/hosts \u53ef\u4ee5\u88ab\u627e\u5230 IP \u7684\u5bf9\u5e94&#xff0c; \u5426\u5219\u4f1a\u51fa\u73b0\u95ee\u9898\u3002\u53e6\u5916&#xff0c;\u4e07\u4e00\u5728\u6267\u884c ypinit -m \u65f6&#xff0c;\u51fa\u73b0\u5982\u4e0b\u7684\u9519\u8bef&#xff0c;\u90a3\u80af\u5b9a\u5c31\u662f\u6709\u4e9b\u6570\u636e\u6ca1\u6709\u88ab\u5efa\u7acb\u4e86&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">gmake[1]: *** No rule to make target &#096;\/etc\/aliases&#039;, needed by &#096;mail.aliases&#039;.  Stop.<br \/>\ngmake[1]: Leaving directory &#096;\/var\/yp\/vbirdnis&#039;<br \/>\nmake: *** [target] Error 2<br \/>\nError running Makefile.<br \/>\nPlease try it by hand.<\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">touch \/etc\/aliases<\/span><br \/>\n<span style=\"color:#ff6666\"># \u89e3\u51b3\u65b9\u6cd5\u5f88\u7b80\u5355\u5436&#xff01;\u7f3a\u5c11\u4ec0\u4e48\u6863\u6848&#xff0c;\u5c31 touch \u4ed6\u5c31\u662f\u4e86&#xff01;<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/usr\/lib64\/yp\/ypinit -m<\/span><br \/>\n<span style=\"color:#ff6666\"># \u7136\u540e\u518d\u91cd\u65b0\u6267\u884c\u4e00\u6b21\u5373\u53ef&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u662f\u5982\u4e0b\u7684\u9519\u8bef&#xff0c;\u90a3\u53ef\u80fd\u662f\u56e0\u4e3a&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f60\u7684 ypserv \u670d\u52a1\u6ca1\u6709\u987a\u5229\u542f\u52a8&#xff0c;\u8bf7\u5229\u7528 rpcinfo \u68c0\u67e5\u770b\u770b&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f60\u7684\u4e3b\u673a\u540d\u4e0e IP \u6ca1\u6709\u5bf9\u5e94\u597d&#xff0c;\u8bf7\u68c0\u67e5 \/etc\/hosts<\/span><\/span><\/li>\n<\/ul>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">gmake[1]: Entering directory &#096;\/var\/yp\/vbirdnis&#039;<br \/>\nUpdating passwd.byname&#8230;<br \/>\nfailed to send &#039;clear&#039; to local ypserv: RPC: Program not registeredUpdating passwd.byuid&#8230;<br \/>\nfailed to send &#039;clear&#039; to local ypserv: RPC: Program not registeredUpdating group.byname&#8230;<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u5e95\u4e0b\u7701\u7565)&#8230;.<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8981\u6ce8\u610f\u554a&#xff0c;\u5982\u679c\u4f60\u7684\u7528\u6237\u5bc6\u7801\u6709\u53d8\u52a8\u8fc7&#xff0c;\u90a3\u4e48\u4f60\u5c31\u5f97\u8981\u91cd\u65b0\u5236\u4f5c\u6570\u636e\u5e93&#xff0c;\u91cd\u65b0\u542f\u52a8 ypserv \u53ca yppasswdd \u5594&#xff01; \u6ce8\u610f\u6ce8\u610f\u554a&#xff01;\u6574\u4e2a NIS \u670d\u52a1\u5668\u8fd9\u6837\u5c31\u7ed9\u641e\u5b9a\u4e86&#xff0c;\u6709\u6ca1\u6709\u5f88\u7b80\u5355\u554a&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.2.5 \u9632\u706b\u5899\u8bbe\u7f6e<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53c8\u6765\u5230\u4e86\u9632\u706b\u5899\u7684\u89c4\u5212\u4e86&#xff01;\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u6211\u4eec\u7684 NIS \u4e0e NFS \u90fd\u662f\u4f7f\u7528 RPC Server \u7684&#xff0c;\u6240\u4ee5\u5570&#xff0c;\u9664\u4e86\u4e0a\u8ff0\u8c08\u5230\u7684\u56fa\u5b9a\u57e0\u53e3\u4e4b\u5916&#xff0c; \u4f60\u8fd8\u5f97\u8981\u5f00\u653e port 111 \u624d\u884c\u3002\u5047\u8bbe\u4f60\u5df2\u7ecf\u770b\u8fc7\u524d\u4e00\u7ae0&#xff0c;\u800c\u4e14\u662f\u4f7f\u7528\u9e1f\u54e5\u7684 iptables.rule \u811a\u672c\u6765\u5904\u7406\u4f60\u7684\u9632\u706b\u5899&#xff0c; \u90a3\u4e48\u4f60\u53ef\u4ee5\u4fee\u6539\u8be5\u6863\u6848\u7684\u5185\u5bb9&#xff0c;\u65b0\u589e\u51e0\u6761\u89c4\u5219\u53bb&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/usr\/local\/virus\/iptables\/iptables.allow<\/span><br \/>\n<span style=\"color:#FFFF00\">iptables -A INPUT -i $EXTIF -p tcp -s 192.168.100.0\/24 &#8211;dport 1011 -j ACCEPT<br \/>\niptables -A INPUT -i $EXTIF -p udp -s 192.168.100.0\/24 -m multiport \\\\<br \/>\n         &#8211;dport 1011,1012 -j ACCEPT<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/usr\/local\/virus\/iptables\/iptables.rule<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5343\u4e07\u8bb0\u5f97\u8981\u91cd\u65b0\u5efa\u7f6e\u9632\u706b\u5899\u89c4\u5219\u554a&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.3 NIS Client \u7aef\u7684\u8bbe\u5b9a<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u4eec\u77e5\u9053\u7f51\u7edc\u8054\u673a\u662f\u53cc\u5411\u7684&#xff0c;\u6240\u4ee5 NIS server \u63d0\u4f9b\u6570\u636e\u5e93\u6863\u6848&#xff0c;NIS client \u5f53\u7136\u4e5f\u9700\u8981\u63d0\u4f9b\u4e00\u4e9b\u8054\u673a\u7684\u8f6f\u4ef6\u5570&#xff01;\u8fd9\u4e2a\u8054\u673a\u7684\u8f6f\u4ef6\u5c31\u662f ypbind \u5566&#xff01;\u6b64\u5916&#xff0c;\u5982\u540c\u56fe 14.1-1\u00a0\u7684\u4ecb\u7ecd&#xff0c;\u5728 NIS client \u7aef\u6709\u767b\u5165\u9700\u6c42\u65f6&#xff0c;NIS client \u57fa\u672c\u4e0a\u8fd8\u662f\u5148\u641c\u5bfb\u81ea\u5df1\u7684 \/etc\/passwd, \/etc\/group \u7b49\u6570\u636e\u540e\u624d\u518d\u53bb\u627e NIS server \u7684\u6570\u636e\u5e93\u554a&#xff01;<span style=\"color:#000088\">\u6240\u4ee5 NIS client \u6700\u597d\u80fd\u591f\u5c06\u672c\u8eab\u7684\u8d26\u53f7\u5bc6\u7801\u5220\u9664\u5230\u4ec5\u5269\u4e0b\u7cfb\u7edf\u8d26\u53f7&#xff0c;\u4ea6\u5373 UID, GID \u5747\u5c0f\u4e8e 500 \u4ee5\u4e0b\u7684\u8d26\u53f7\u5373\u53ef<\/span>&#xff0c; \u5982\u6b64\u4e00\u6765\u65e2\u53ef\u8ba9\u7cfb\u7edf\u6267\u884c\u65e0\u8bef&#xff0c;\u4e5f\u80fd\u591f\u8ba9\u767b\u5165\u8005\u7684\u4fe1\u606f\u5b8c\u5168\u6765\u81ea NIS server &#xff0c;\u6bd4\u8f83\u5355\u7eaf\u5566&#xff01;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Tips:<span style=\"color:#009000\">\u4e8b\u5b9e\u4e0a&#xff0c;\u4f60\u60f3\u8981\u8ba9 NIS \u670d\u52a1\u5668\u5199\u5165\u7684\u5404\u9879\u8d26\u53f7\u6570\u636e\u90fd\u5728 NIS server \u7684 \/var\/yp\/Makefile \u90a3\u4e2a\u6863\u6848\u8bbe\u5b9a\u7684&#xff01; \u4f60\u53ef\u4ee5\u8fdb\u5165\u8be5\u6863\u6848\u641c\u5bfb\u4e00\u4e0b UID \u5c31\u77e5\u9053\u4e86&#xff01; ^_^<\/span><\/span><\/span><\/td>\n<td>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u9e1f\u54e5\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061107-68033e7bd21ca.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.3.1 NIS client \u6240\u9700\u8f6f\u4ef6\u4e0e\u8f6f\u4ef6\u7ed3\u6784<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS client \u7aef\u6240\u9700\u8981\u7684\u8f6f\u4ef6\u4ec5\u6709&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">ypbind<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">yp-tools<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">yp-tools \u662f\u63d0\u4f9b\u67e5\u8be2\u7684\u8f6f\u4ef6&#xff0c;\u81f3\u4e8e ypbind \u5219\u662f\u4e0e ypserv \u4e92\u76f8\u6c9f\u901a\u7684\u5ba2\u6237\u7aef\u8054\u673a\u8f6f\u4ef6\u5566&#xff01; \u53e6\u5916&#xff0c;\u5728 CentOS \u5f53\u4e2d\u6211\u4eec\u8fd8\u6709\u5f88\u591a\u914d\u7f6e\u6587\u4ef6\u662f\u4e0e\u8ba4\u8bc1\u6709\u5173\u7684&#xff0c;\u5305\u542b ypbind \u7684\u914d\u7f6e\u6587\u4ef6\u65f6&#xff0c; \u5728\u8bbe\u5b9a NIS client \u4f60\u53ef\u80fd\u9700\u8981\u52a8\u5230\u5e95\u4e0b\u7684\u6863\u6848&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/sysconfig\/network<\/span>&#xff1a;\u5c31\u662f NIS \u7684\u9886\u57df\u540d\u561b&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/hosts<\/span>&#xff1a;\u81f3\u5c11\u9700\u8981\u6709\u5404\u4e2a NIS \u670d\u52a1\u5668\u7684 IP \u4e0e\u4e3b\u673a\u540d\u5bf9\u5e94&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/yp.conf<\/span>&#xff1a;\u8fd9\u4e2a\u5219\u662f ypbind \u7684\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6&#xff0c;\u91cc\u9762\u4e3b\u8981\u8bbe\u5b9a NIS \u670d\u52a1\u5668\u6240\u5728<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/sysconfig\/authconfig<\/span>&#xff1a;\u89c4\u8303\u8d26\u53f7\u767b\u5165\u65f6\u7684\u5141\u8bb8\u8ba4\u8bc1\u673a\u5236&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/pam.d\/system-auth<\/span>\u00a0&#xff1a;\u8fd9\u4e2a\u6700\u5bb9\u6613\u5fd8\u8bb0&#xff01;\u56e0\u4e3a\u8d26\u53f7\u901a\u5e38\u7531 PAM \u6a21\u5757\u6240\u7ba1\u7406&#xff0c; \u6240\u4ee5\u4f60\u5fc5\u987b\u8981\u5728 PAM \u6a21\u5757\u5185\u52a0\u5165 NIS \u7684\u652f\u6301\u624d\u884c&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\/etc\/nsswitch.conf<\/span>\u00a0&#xff1a;\u8fd9\u4e2a\u6863\u6848\u53ef\u4ee5\u89c4\u8303\u8d26\u53f7\u5bc6\u7801\u4e0e\u76f8\u5173\u4fe1\u606f\u7684\u67e5\u8be2\u987a\u5e8f&#xff0c;\u9ed8\u8ba4\u662f\u5148\u627e \/etc\/passwd \u518d\u627e NIS \u6570\u636e\u5e93&#xff1b;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53e6\u5916&#xff0c; NIS \u8fd8\u63d0\u4f9b\u4e86\u51e0\u4e2a\u6709\u8da3\u7684\u7a0b\u5e8f\u7ed9 NIS \u5ba2\u6237\u7aef\u6765\u8fdb\u884c\u8d26\u53f7\u76f8\u5173\u53c2\u6570\u7684\u4fee\u6539&#xff0c;\u4f8b\u5982\u5bc6\u7801\u3001shell \u7b49\u7b49&#xff0c; \u4e3b\u8981\u6709\u5e95\u4e0b\u8fd9\u51e0\u4e2a\u6307\u4ee4&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/usr\/bin\/yppasswd &#xff1a;\u66f4\u6539\u4f60\u5728 NIS database (NIS Server \u6240\u5236\u4f5c\u7684\u6570\u636e\u5e93) \u7684\u5bc6\u7801<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/usr\/bin\/ypchsh \u00a0 &#xff1a;\u540c\u4e0a&#xff0c;\u4f46\u662f\u662f\u66f4\u6539 shell<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/usr\/bin\/ypchfn \u00a0 &#xff1a;\u540c\u4e0a&#xff0c;\u4f46\u662f\u662f\u66f4\u6539\u4e00\u4e9b\u7528\u6237\u7684\u8baf\u606f&#xff01;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">OK&#xff01;\u90a3\u4e48\u5e95\u4e0b\u5c31\u8ba9\u6211\u4eec\u5f00\u59cb\u6765\u8bbe\u5b9a NIS \u5ba2\u6237\u7aef\u5427&#xff01;^_^<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.3.2 NIS client \u7684\u8bbe\u5b9a\u4e0e\u542f\u52a8<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u542f\u52a8 NIS client \u7684\u8bbe\u5b9a\u5c31\u7b80\u5355\u591a\u4e86&#xff01;\u6700\u4e3b\u8981\u662f\u52a0\u5165 NIS domain \u5f53\u4e2d&#xff0c;\u7136\u540e\u518d\u542f\u52a8 ypbind \u5373\u53ef\u3002 \u867d\u7136\u4f60\u53ef\u4ee5\u624b\u52a8\u53bb\u4fee\u6539\u6240\u6709\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u7136\u800c\u8fd1\u671f\u4ee5\u6765\u7684 Linux distributions \u8d26\u53f7\u5904\u7406\u673a\u5236\u8d8a\u6765\u8d8a\u590d\u6742&#xff0c; \u6240\u4ee5\u5982\u679c\u4f60\u60f3\u8981\u624b\u52a8\u4fee\u6539\u6240\u6709\u914d\u7f6e\u6587\u4ef6&#xff0c;\u6050\u6015\u4f1a\u75af\u6389\u7684&#xff5e;\u56e0\u6b64&#xff0c;\u8fd9\u91cc\u5efa\u8bae\u4f60\u4f7f\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684\u5de5\u5177\u6765\u8bbe\u5b9a&#xff0c; \u81f3\u4e8e\u4e00\u4e9b\u91cd\u8981\u914d\u7f6e\u6587\u4ef6&#xff0c;\u6700\u540e\u6709\u673a\u4f1a\u518d\u53bb\u53c2\u8003\u4e00\u4e0b\u5373\u53ef\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u90a3\u4e48 CentOS 6.x \u63d0\u4f9b\u4e86\u4ec0\u4e48\u597d\u7528\u7684\u7ba1\u7406\u5de5\u5177\u5462&#xff1f;\u5f88\u7b80\u5355&#xff0c;\u5c31\u5229\u7528 setup \u8fd9\u4e2a\u6307\u4ee4\u5373\u53ef&#xff01;\u8f93\u5165 setup \u5c31\u4f1a\u51fa\u73b0\u5982\u4e0b\u7684\u56fe\u793a&#xff0c; \u7136\u540e\u4f9d\u5e8f\u8fd9\u4e48\u5904\u7406\u5c31\u597d\u4e86\u5466&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 14.3-1\u3001\u5229\u7528 setup \u8fdb\u5165 authconfig \u8ba4\u8bc1\u9879\u76ee<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8bb0\u5f97\u5728\u51fa\u73b0\u4e0a\u56fe 14.3-1 \u540e&#xff0c;\u9009\u62e9\u8ba4\u8bc1\u8bbe\u5b9a&#xff0c;\u5982\u679c\u662f\u51fa\u73b0\u82f1\u6587\u7684\u8bdd&#xff0c;\u90a3\u4e48\u4f60\u5c31\u5f97\u8981\u9009\u62e9\u300eAuthentication configuration\u300f\u7684\u9879\u76ee&#xff0c;\u4e4b\u540e\u5c31\u4f1a\u8fdb\u5165\u4e0b\u9762\u7684\u753b\u9762&#xff1a;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 14.3-2\u3001\u8fdb\u5165 authconfig \u4e4b\u540e&#xff0c;\u9009\u62e9 NIS \u9879\u76ee<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u4e3a\u6211\u4eec\u8981\u7528 NIS \u4f5c\u4e3a\u767b\u5165\u8005\u8eab\u4efd\u9a8c\u8bc1\u7684\u673a\u5236&#xff0c;\u56e0\u6b64\u5c31\u5f97\u8981\u9009\u62e9 NIS \u9879\u76ee&#xff0c;\u5982\u679c\u662f\u82f1\u6587\u7684\u8bdd&#xff0c;\u5f97\u8981\u9009\u62e9\u300eUse NIS\u300f\u9879\u76ee\u5373\u53ef\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 14.3-3\u3001\u586b\u5199 NIS \u9886\u57df\u4ee5\u53ca NIS \u670d\u52a1\u5668\u7684 IP \u5373\u53ef<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6700\u540e\u518d\u586b\u5199 NIS \u7f51\u57df (Domain) \u4ee5\u53ca NIS \u670d\u52a1\u5668\u7684 IP (Server)&#xff0c;\u6309\u4e0b\u786e\u5b9a\u5373\u53ef\u3002\u5982\u679c\u7cfb\u7edf\u5f88\u5feb\u7684\u5c31\u8df3\u56de\u56fe 14.3-1 \u7684\u753b\u9762&#xff0c; \u4ee3\u8868\u4f60\u7684\u8bbe\u5b9a\u7406\u8bba\u4e0a\u662f\u6ca1\u6709\u95ee\u9898\u7684\u3002\u5982\u679c\u4e00\u76f4\u5361\u5728\u5982\u4e0b\u7684\u753b\u9762\u4e2d&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u6b63\u5728\u6fc0\u6d3b rpcbind&#xff1a;                                         [  \u786e\u5b9a  ]<br \/>\n\u6b63\u5728\u5173\u95ed NIS \u670d\u52a1&#xff1a;                                        [  \u786e\u5b9a  ]<br \/>\n\u6b63\u5728\u542f\u52a8 NIS \u670d\u52a1&#xff1a;                                        [  \u786e\u5b9a  ]<br \/>\n\u6b63\u5728\u7ed1\u5b9a NIS \u670d\u52a1&#xff1a;&#8230;&#8230;.  <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u91cc\u4e00\u76f4\u5361\u4f4f&#xff0c;\u6ca1\u529e\u6cd5\u7ed3\u675f<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0a\u8ff0\u7684\u6570\u636e\u5c31\u662f\u51fa\u95ee\u9898\u5566&#xff01;\u90a3\u4ee3\u8868\u4f60\u7684 NIS client \u6ca1\u6709\u529e\u6cd5\u8fde\u63a5\u4e0a NIS server&#xff0c;\u6700\u5e38\u53d1\u751f\u7684\u5c31\u662f<span style=\"color:#000088\">\u670d\u52a1\u5668\u7684\u9632\u706b\u5899\u5fd8\u8bb0\u653e\u884c&#xff0c;\u6216\u8005\u662f\u4f60\u5ba2\u6237\u7aef\u8f93\u5165\u670d\u52a1\u5668 IP \u65f6&#xff0c;\u6253\u9519\u6570\u5b57\u4e86<\/span>&#xff5e; \u90a3\u4e5f\u662f\u5f88\u5e38\u53d1\u751f\u7684\u9519\u8bef\u5566&#xff01;\u8fd9\u65f6\u8bf7\u81ea\u884c\u53bb\u4fee\u6539\u4e00\u756a\u5427&#xff01;\u90a3\u4e48\u8fd9\u4e2a setup \u5230\u5e95\u505a\u4e86\u4ec0\u4e48\u4fee\u6539\u5462&#xff1f;\u6211\u4eec\u4e5f\u6765\u770b\u770b\u51e0\u4e2a\u88ab\u6539\u6389\u7684\u91cd\u8981\u914d\u7f6e\u6587\u4ef6\u5427&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">cat \/etc\/sysconfig\/network<\/span><br \/>\nHOSTNAME&#061;clientlinux.centos.vbird<br \/>\nNETWORKING&#061;yes<br \/>\nGATEWAY&#061;192.168.100.254<br \/>\nNISDOMAIN&#061;vbirdnis    <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u4e2a\u73a9\u610f\u513f\u4f1a\u4e3b\u52a8\u7684\u88ab\u5efa\u7acb\u8d77\u6765<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">cat \/etc\/yp.conf<\/span><br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u524d\u9762\u7701\u7565)&#8230;.<\/span><br \/>\ndomain vbirdnis server 192.168.100.254  <span style=\"color:#777777\">&lt;&#061;&#061;\u4e3b\u52a8\u5efa\u7acb\u8fd9\u73a9\u610f\u513f&#xff5e;<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">vim \/etc\/nsswitch.conf<\/span><br \/>\npasswd:     files nis<br \/>\nshadow:     files nis<br \/>\ngroup:      files nis<br \/>\nhosts:      files nis dns<br \/>\n<span style=\"color:#ff6666\"># \u4e0a\u9762\u51e0\u4e2a\u9879\u76ee\u662f\u6bd4\u8f83\u91cd\u8981\u7684&#xff0c;\u5305\u62ec\u8eab\u4efd\u53c2\u6570\u3001\u5bc6\u7801\u3001\u7fa4\u7ec4\u540d\u3001\u4e3b\u673a\u540d\u4e0e IP \u5bf9\u5e94\u6570\u636e\u7b49\u3002<br \/>\n# \u4f60\u4f1a\u770b\u5230&#xff0c;\u6bcf\u4e2a\u9879\u76ee\u540e\u9762\u90fd\u4f1a\u63a5\u7740 nis &#xff0c;\u6240\u4ee5 nis \u6709\u88ab\u652f\u6301\u5570&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u4e3a\u66f4\u52a8\u5230\u7684\u6863\u6848\u5b9e\u5728\u592a\u591a\u4e86&#xff0c;\u6240\u4ee5\u9e1f\u54e5\u8fd8\u662f\u5efa\u8bae\u4f7f\u7528 setup \u6765\u8c03\u6574\u5373\u53ef\u3002\u4f46\u662f&#xff0c;\u5982\u679c\u4f60\u771f\u7684\u60f3\u8981\u624b\u52a8\u5904\u7406\u7684\u8bdd&#xff0c; \u90a3\u4e48\u4f60\u5fc5\u987b\u8981\u624b\u52a8\u7684\u4fee\u6539\u5e95\u4e0b\u8fd9\u4e9b\u6863\u6848&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/sysconfig\/network (\u52a0\u5165 NISDOMAIN \u9879\u76ee)<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/nsswitch.conf (\u4fee\u6539\u8bb8\u591a\u4e3b\u673a\u9a8c\u8bc1\u529f\u80fd\u7684\u987a\u5e8f)<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/sysconfig\/authconfig (CentOS \u7684\u8ba4\u8bc1\u673a\u5236)<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/pam.d\/system-auth (\u8bb8\u591a\u767b\u5165\u6240\u9700\u8981\u7684 PAM \u8ba4\u8bc1\u8fc7\u7a0b)<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/yp.conf (\u4ea6\u5373\u662f ypbind \u7684\u914d\u7f6e\u6587\u4ef6)<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.3.3 NIS client \u7aef\u7684\u68c0\u9a8c&#xff1a; yptest, ypwhich, ypcat<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u4f55\u786e\u5b9a NIS client \u5df2\u7ecf\u8fde\u4e0a NIS server \u5462&#xff1f;\u57fa\u672c\u4e0a&#xff0c;\u53ea\u8981\u521a\u521a\u4f7f\u7528 setup \u53bb\u8bbe\u5b9a\u65f6&#xff0c;\u6700\u540e\u7684\u6b65\u9aa4\u5e76\u6ca1\u6709\u88ab\u5361\u4f4f&#xff0c; \u90a3\u5e94\u8be5\u5c31\u662f\u987a\u5229\u6210\u529f\u5566&#xff01;\u8be5\u6b65\u9aa4\u4f1a\u81ea\u52a8\u542f\u52a8 rpcbind \u4e0e ypbind \u4e24\u4e2a\u670d\u52a1\u5466&#xff01;\u90a3\u5982\u4f55\u786e\u8ba4\u6570\u636e\u4f20\u9001\u662f\u6b63\u786e\u7684&#xff1f; \u7b80\u5355\u7684\u8981\u547d\u554a&#xff01;\u4f60\u53ef\u4ee5\u5229\u7528 id \u8fd9\u4e2a\u6307\u4ee4\u76f4\u63a5\u68c0\u67e5 NIS server \u6709\u7684&#xff0c;\u4f46\u662f NIS client \u6ca1\u6709\u7684\u8d26\u53f7&#xff0c;\u5982\u679c\u6709\u51fa\u73b0\u8be5\u8d26\u53f7\u7684\u76f8\u5173 UID\/GID \u4fe1\u606f\u65f6&#xff0c;\u90a3\u8868\u793a\u6570\u636e\u4f20\u8f93\u4e5f\u662f\u6b63\u786e\u7684\u3002 \u9664\u6b64\u4e4b\u5916&#xff0c;\u6211\u4eec\u8fd8\u53ef\u4ee5\u900f\u8fc7 NIS \u63d0\u4f9b\u7684\u76f8\u5173\u68c0\u9a8c\u529f\u80fd\u6765\u68c0\u67e5\u5594&#xff01;\u5e95\u4e0b\u5206\u522b\u6765\u77a7\u4e00\u77a7&#xff1a;<\/span><\/span> \u00a0<\/p>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5229\u7528 yptest \u68c0\u9a8c\u6570\u636e\u5e93\u4e4b\u6d4b\u8bd5&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u76f4\u63a5\u5728 NIS client \u8f93\u5165 yptest \u5373\u53ef\u68c0\u67e5\u76f8\u5173\u7684\u6d4b\u8bd5\u6570\u636e&#xff0c;\u5982\u4e0b\u6240\u793a&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">yptest<\/span><br \/>\nTest 1: domainname<br \/>\nConfigured domainname is &#034;vbirdnis&#034;<\/p>\n<p>Test 2: ypbind<br \/>\nUsed NIS server: www.centos.vbird<\/p>\n<p>Test 3: yp_match<br \/>\nWARNING: No such key in map (Map passwd.byname, key nobody)<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><\/p>\n<p>Test 6: yp_master<br \/>\nwww.centos.vbird<\/p>\n<p><span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><\/p>\n<p>Test 8: yp_maplist<br \/>\npasswd.byname<br \/>\nprotocols.byname<br \/>\nhosts.byaddr<br \/>\nhosts.byname<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><\/p>\n<p>Test 9: yp_all<br \/>\nnisuser1 nisuser1:$1$U9Gccb60$K5lDQ.mGBw9x4oNEkM0Lz\/:1001:1001::\/home\/nisuser1:\/bin\/bash<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><br \/>\n1 tests failed<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ece\u8fd9\u4e2a\u6d4b\u8bd5\u5f53\u4e2d\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u4e00\u4e9b\u9519\u8bef&#xff0c;\u5c31\u662f\u5728 Test 3 \u51fa\u73b0\u7684\u90a3\u4e2a\u8b66\u544a\u4fe1\u606f\u5566\u3002\u8fd8\u597d&#xff0c;\u90a3\u53ea\u662f\u8bf4\u6ca1\u6709\u8be5\u6570\u636e\u5e93\u800c\u5df2&#xff5e; \u8be5\u9519\u8bef\u662f\u53ef\u4ee5\u5ffd\u7565\u7684\u3002<span style=\"color:#000088\">\u91cd\u70b9\u5728\u7b2c 9 \u4e2a\u6b65\u9aa4 yp_all \u5fc5\u987b\u8981\u6709\u5217\u51fa\u4f60 NIS server \u4e0a\u5934\u7684\u6240\u6709\u5e10\u6237\u4fe1\u606f&#xff0c;\u5982\u679c\u6709\u51fa\u73b0\u8d26\u53f7\u76f8\u5173\u6570\u636e\u7684\u8bdd&#xff0c;\u90a3\u4e48\u5e94\u8be5\u5c31\u7b97\u9a8c\u8bc1\u6210\u529f\u4e86<\/span>&#xff01;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Tips:<span style=\"color:#009000\">\u6bd4\u8f83\u6709\u95ee\u9898\u7684\u662f\u7b2c\u4e09\u6b65\u9aa4&#xff0c;\u4ed6\u4f1a\u51fa\u73b0\u5728 passwd.byname \u5f53\u4e2d\u627e\u4e0d\u5230 nobody \u7684\u5b57\u6837\u3002\u8fd9\u662f\u56e0\u4e3a\u65e9\u671f\u7684 nobody \u4e4b UID \u90fd\u8bbe\u5b9a\u5728 65534 &#xff0c;\u4f46 CentOS \u5219\u5c06 nobody \u8bbe\u5b9a\u4e3a\u7cfb\u7edf\u8d26\u53f7\u7684 99 &#xff0c;\u6240\u4ee5\u5f53\u7136\u4e0d\u4f1a\u88ab\u8bb0\u5f55&#xff0c;\u4e5f\u5c31\u51fa\u73b0\u8fd9\u4e00\u4e2a\u8b66\u544a\u3002\u4e0d\u8fc7&#xff0c;\u8fd9\u4e2a\u9519\u8bef\u662f\u53ef\u5ffd\u7565\u7684\u5566&#xff01;<\/span><\/span><\/span><\/td>\n<td>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u9e1f\u54e5\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061108-68033e7c3657b.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5229\u7528 ypwhich \u68c0\u9a8c\u6570\u636e\u5e93\u6570\u91cf<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5355\u7eaf\u4f7f\u7528 ypwhich \u7684\u65f6\u5019\u663e\u793a\u7684\u662f\u300eNIS Client \u7684 domain\u300f\u540d\u79f0&#xff0c;\u800c\u5f53\u52a0\u5165 -x \u8fd9\u4e2a\u53c2\u6570\u65f6&#xff0c; \u5219\u662f\u663e\u793a\u300eNIS Client \u4e0e Server \u4e4b\u95f4\u6c9f\u901a\u7684\u6570\u636e\u5e93\u6709\u54ea\u4e9b&#xff1f;\u300f\u4f60\u53ef\u4ee5\u8fd9\u6837\u6d4b\u8bd5\u54e9&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">ypwhich -x<\/span><br \/>\nUse &#034;hosts&#034;     for map &#034;hosts.byname&#034;<br \/>\nUse &#034;group&#034;     for map &#034;group.byname&#034;<br \/>\nUse &#034;passwd&#034;    for map &#034;passwd.byname&#034;<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4ee5\u4e0b\u7701\u7565)&#8230;.<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e0a\u9762\u6211\u4eec\u53ef\u4ee5\u5f88\u6e05\u695a\u7684\u5c31\u770b\u5230\u76f8\u5173\u7684\u6863\u6848\u5566&#xff01;\u8fd9\u4e9b\u6570\u636e\u5e93\u6863\u6848\u5219\u662f\u653e\u7f6e\u5728\u6211\u7684 NIS Server \u7684 \/var\/yp\/vbirdnis\/* \u91cc\u9762\u5570&#xff01;<\/span><\/span> \u00a0<\/p>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5229\u7528 ypcat \u8bfb\u53d6\u6570\u636e\u5e93\u5185\u5bb9<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u9664\u4e86 yptest \u4e4b\u5916&#xff0c;\u4f60\u8fd8\u53ef\u4ee5\u76f4\u63a5\u5229\u7528 ypcat \u8bfb\u53d6\u6570\u636e\u5e93\u7684\u5185\u5bb9\u5594&#xff01;\u4e00\u822c\u4f5c\u6cd5\u662f\u8fd9\u6837&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">ypcat [-h nisserver] [\u6570\u636e\u5e93\u540d\u79f0]<\/span><br \/>\n<span style=\"color:#ff6666\">\u9009\u9879\u4e0e\u53c2\u6570&#xff1a;<br \/>\n-h nisserver &#xff1a;\u5982\u679c\u6709\u8bbe\u5b9a\u7684\u8bdd&#xff0c;\u6307\u5411\u67d0\u4e00\u90e8\u7279\u5b9a\u7684 NIS \u670d\u52a1\u5668&#xff0c;<br \/>\n               \u5982\u679c\u6ca1\u6709\u6307\u5b9a\u7684\u8bdd&#xff0c;\u5c31\u4ee5 ypbind \u4e4b\u8bbe\u5b9a\u4e3a\u4e3b&#xff1b;<br \/>\n\u6570\u636e\u5e93\u540d\u79f0&#xff1a;\u4ea6\u5373\u5728 \/var\/yp\/vbirdnis\/ \u5185\u7684\u6863\u540d\u554a&#xff01;\u4f8b\u5982 passwd.byname<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># \u8bfb\u51fa passwd.byname \u7684\u6570\u636e\u5e93\u5185\u5bb9<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">ypcat passwd.byname<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e09\u4e2a\u6307\u4ee4\u5728\u8fdb\u884c NIS Client \u7aef\u7684\u68c0\u9a8c\u65f6&#xff0c;\u662f\u76f8\u5f53\u6709\u7528\u7684\u5594&#xff01;\u4e0d\u8981\u5ffd\u7565\u4e86\u4ed6\u7684\u5b58\u5728\u554a&#xff01;\u5c24\u5176\u662f\u521a\u67b6\u8bbe\u597d NIS Client \u65f6&#xff0c;\u4e00\u5b9a\u8981\u4f7f\u7528 yptest \u53bb\u68c0\u67e5\u770b\u770b\u6709\u6ca1\u6709\u8bbe\u5b9a\u9519\u8bef\u5594&#xff01;\u6839\u636e\u5c4f\u5e55\u663e\u793a\u7684\u8baf\u606f\u53bb\u4e00\u4e2a\u4e00\u4e2a\u6821\u6b63\u9519\u8bef\u624d\u884c\u554a&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span><br \/>\n <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">14.3.4 \u4f7f\u7528\u8005\u53c2\u6570\u4fee\u6539&#xff1a; yppasswd, ypchfn, ypchsh<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u597d\u4e86&#xff0c;\u5b8c\u6210\u4e86\u4e0a\u8ff0\u7684\u8bbe\u5b9a\u540e&#xff0c;\u4f60\u7684 NIS server\/client \u7684\u8d26\u53f7\u5df2\u7ecf\u540c\u6b65\u4e86&#xff01;\u771f\u662f\u9ad8\u5174\u4e0d\u662f\u5417&#xff1f; \u4e0d\u8fc7&#xff0c;\u8fd8\u6709\u4e2a\u633a\u5927\u7684\u95ee\u9898&#xff0c;\u90a3\u5c31\u662f&#8230;\u4f7f\u7528\u8005\u5982\u4f55\u5728 NIS client \u4fee\u6539\u4ed6\u81ea\u5df1\u7684\u767b\u5165\u53c2\u6570&#xff0c;\u4f8b\u5982\u5bc6\u7801\u3001shell \u7b49\u7b49&#xff1f; \u56e0\u4e3a NIS client \u662f\u85c9\u7531\u6570\u636e\u5e93\u6765\u53d6\u5f97\u7528\u6237\u7684\u8d26\u53f7\u5bc6\u7801&#xff0c;\u90a3\u5982\u4f55\u5728 NIS \u5ba2\u6237\u7aef\u5904\u7406\u8d26\u53f7\u5bc6\u7801\u7684\u8ba2\u6b63&#xff1f;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u95ee\u7684\u597d&#xff01;\u8fd9\u4e5f\u662f\u4e3a\u4f55\u6211\u4eec\u9700\u8981\u5728 NIS server \u542f\u52a8 yppasswdd \u8fd9\u652f\u670d\u52a1\u7684\u4e3b\u8981\u7528\u610f&#xff01; \u56e0\u4e3a yppasswdd \u53ef\u4ee5\u63a5\u6536 NIS client \u7aef\u4f20\u6765\u7684\u5bc6\u7801\u4fee\u6539&#xff0c;\u85c9\u6b64\u800c\u5904\u7406 NIS server \u7684 \/etc\/passwd, \/etc\/shadow &#xff0c; \u7136\u540e yppasswdd \u8fd8\u80fd\u591f\u91cd\u5efa\u5bc6\u7801\u6570\u636e\u5e93&#xff0c;\u8ba9 NIS server \u540c\u6b65\u66f4\u65b0\u6570\u636e\u5e93&#xff01;\u771f\u662f\u5f88\u4e0d\u9519\u554a&#xff01; ^_^<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u90a3\u8be5\u5982\u4f55\u4e0b\u8fbe\u6307\u4ee4\u5462&#xff1f;\u5f88\u7b80\u5355\u554a&#xff01;\u900f\u8fc7 yppasswd, ypchsh, ypchfn \u6765\u5904\u7406\u5373\u53ef\u3002\u8fd9\u4e09\u4e2a\u6307\u4ee4\u7684\u5bf9\u5e94\u662f&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">yppasswd &#xff1a;\u4e0e passwd \u6307\u4ee4\u76f8\u540c\u529f\u80fd&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">ypchfn &#xff1a;\u4e0e chfn \u76f8\u540c\u529f\u80fd&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">ypchsh &#xff1a;\u4e0e chsh \u76f8\u540c\u529f\u80fd\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u4e3a\u529f\u80fd\u76f8\u5f53&#xff0c;\u6240\u4ee5\u9e1f\u54e5\u8fd9\u91cc\u4ec5\u8bf4\u660e\u4e00\u4e0b yppasswd \u800c\u5df2\u3002\u5047\u8bbe\u4f60\u5df2\u7ecf\u767b\u5165 NIS client \u90a3\u90e8\u4e3b\u673a&#xff0c; \u5e76\u4e14\u662f\u4ee5 nisuser1 \u8fd9\u4e2a\u4f7f\u7528\u8005\u767b\u5165\u7684&#xff0c;\u8bb0\u4f4f&#xff0c;\u8fd9\u4e2a\u7528\u6237\u76f8\u5173\u6570\u636e\u4ec5\u5728 NIS server \u4e0a\u3002 \u63a5\u4e0b\u6765&#xff0c;\u8fd9\u4e2a\u4f7f\u7528\u8005\u53ef\u4ee5\u4e0b\u8fbe yppasswd &#xff0c;\u5982\u4e0b\u6240\u793a&#xff1a;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">grep nisuser \/etc\/passwd<\/span>  <span style=\"color:#777777\">&lt;&#061;&#061;\u4e0d\u4f1a\u51fa\u73b0\u4efb\u4f55\u8baf\u606f&#xff0c;\u56e0\u4e3a\u65e0\u6b64\u8d26\u53f7<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">su &#8211; nisuser1           <\/span>  <span style=\"color:#777777\">&lt;&#061;&#061;\u76f4\u63a5\u5207\u6362\u8eab\u4efd\u770b\u770b&#xff01;<\/span><br \/>\nsu: warning: cannot change directory to \/home\/nisuser1: No such file or directory<br \/>\n-bash-4.1$ <span style=\"color:#FFFF00\">id<\/span><br \/>\nuid&#061;1001(nisuser1) gid&#061;1001(nisuser1) groups&#061;1001(nisuser1)<br \/>\n<span style=\"color:#ff6666\"># \u56e0\u4e3a\u6211\u4eec client.centos.vbird \u4ec5\u6709\u5e10\u6237\u4fe1\u606f&#xff0c;\u5e76\u6ca1\u6709\u7528\u6237\u5bb6\u76ee\u5f55&#xff0c;<br \/>\n# \u6240\u4ee5\u5c31\u4f1a\u51fa\u73b0\u5982\u4e0a\u7684\u8b66\u544a&#xff0c;\u56e0\u6b64\u624d\u9700\u8981\u7528 id \u9a8c\u8bc1&#xff0c;\u5e76\u4e14\u9700\u8981\u52a0\u6302 NFS \u561b&#xff01;<br \/>\n# \u4ed4\u7ec6\u770b&#xff0c;\u73b0\u5728\u7684\u8eab\u4efd\u786e\u5b9e\u662f nisuser1 \u5594&#xff01;\u786e\u5b9e\u6709\u8fde\u4e0a NIS server \u5566&#xff01;<\/span><\/p>\n<p>-bash-4.1$ <span style=\"color:#FFFF00\">yppasswd<\/span><br \/>\nChanging NIS account information for nisuser1 on www.centos.vbird.<br \/>\nPlease enter old password:    <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u91cc\u8f93\u5165\u65e7\u5bc6\u7801<\/span><br \/>\nChanging NIS password for nisuser1 on www.centos.vbird.<br \/>\nPlease enter new password:    <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u91cc\u8f93\u5165\u65b0\u5bc6\u7801<\/span><br \/>\nPlease retype new password:   <span style=\"color:#777777\">&lt;&#061;&#061;\u518d\u8f93\u5165\u4e00\u904d<\/span><\/p>\n<p>The NIS password has been changed on www.centos.vbird.<\/p>\n<p>-bash-4.1$ <span style=\"color:#FFFF00\">exit<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u563f\u563f&#xff01;\u5982\u4f55&#xff0c;\u8fd9\u6837\u5c31\u66f4\u65b0\u4e86 NIS server \u4e0a\u5934\u7684 \/etc\/shadow \u4ee5\u53ca \/var\/yp\/vbirdnis\/passwd.by* \u7684\u6570\u636e\u5e93&#xff0c; \u7b80\u5355\u5427&#xff01;\u4e00\u4e0b\u5b50\u5c31\u540c\u6b65\u5316\u4e86\u3002\u4e0d\u8fc7&#xff0c;\u5982\u679c\u8981\u6559\u80b2\u4f7f\u7528\u8005\u4f7f\u7528 yppasswd \u7684\u8bdd&#xff0c;\u4ed6\u53ef\u80fd\u4e0d\u592a\u80fd\u9002\u5e94&#xff0c; \u4e0d\u8981\u7d27&#xff0c;\u4f60\u53ef\u4ee5\u900f\u8fc7\u4fee\u6539 alias \u6216\u8005\u662f\u7f6e\u6362\u6389 \/usr\/bin\/passwd \u8fd9\u652f\u7a0b\u5e8f\u5373\u53ef&#xff01;\u90a3\u73b0\u5728\u8ba9\u6211\u4eec\u56de\u5230 NIS \u670d\u52a1\u5668\u7aef\u770b\u770b\u771f\u7684\u6709\u66f4\u52a8\u5230\u6570\u636e\u5e93\u5417&#xff1f;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">[root&#064;www ~]# <span style=\"color:#FFFF00\">ll \/var\/yp\/vbirdnis\/<\/span><br \/>\n-rw&#8212;&#8212;-. 1 root root   13836 Jul 28 13:10 netid.byname<br \/>\n-rw&#8212;&#8212;-. 1 root root   14562 <span style=\"color:#FFFF00\">Jul 28 13:29 passwd.byname<\/span><br \/>\n-rw&#8212;&#8212;-. 1 root root   14490 <span style=\"color:#FFFF00\">Jul 28 13:29 passwd.byuid<\/span><br \/>\n-rw&#8212;&#8212;-. 1 root root   28950 Jul 28 13:10 protocols.byname<br \/>\n<span style=\"color:#ff6666\"># \u4ed4\u7ec6\u770b&#xff0c;\u5c31\u662f\u90a3\u4e2a\u5bc6\u7801\u6863\u6848\u88ab\u66f4\u52a8\u8fc7&#xff5e;\u65f6\u95f4\u5df2\u7ecf\u4e0d\u4e00\u6837\u4e86&#xff01;\u518d\u770b\u770b\u767b\u5f55\u6863\u5427&#xff01;<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">tail \/var\/log\/messages<\/span><br \/>\nJul 28 13:29:14 www rpc.yppasswdd[1707]: update nisuser1 (uid&#061;1001) from host<br \/>\n192.168.100.10 successful.<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6700\u7ec8\u4ece\u767b\u5f55\u6863\u91cc\u9762&#xff0c;\u6211\u4eec\u4e5f\u80fd\u591f\u5f97\u5230\u76f8\u5173\u7684\u8bb0\u5f55&#xff01;\u8fd9\u6837\u5c31\u975e\u5e38\u5b8c\u7f8e\u5566&#xff01; ^_^<\/span><\/span><\/p>\n<hr \/>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.4 NIS \u642d\u914d NFS \u7684\u8bbe\u5b9a\u5728\u4e1b\u96c6\u8ba1\u7b97\u673a\u4e0a\u7684\u5e94\u7528<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u521a\u521a\u5728 NIS \u5ba2\u6237\u7aef\u7684 nisuser1 \u767b\u5165\u6d4b\u8bd5\u4e2d&#xff0c;\u4f60\u5e94\u8be5\u5df2\u7ecf\u53d1\u73b0\u4e86\u4e00\u4ef6\u4e8b&#xff0c;\u90a3\u5c31\u662f<span style=\"color:#000088\">\u600e\u4e48 nisuser1 \u6ca1\u6709\u5bb6\u76ee\u5f55\u554a&#xff1f;<\/span>\u8fd9\u5f88\u6b63\u5e38\u554a&#xff01;\u56e0\u4e3a nisuser1 \u7684\u5bb6\u76ee\u5f55\u662f\u5728\u670d\u52a1\u5668\u7aef\u7684 \/home \u4e0a\u5934&#xff0c;\u800c\u4f60\u5728\u5ba2\u6237\u7aef\u767b\u5165\u65f6&#xff0c; \u5728\u5ba2\u6237\u7aef\u7684 \/home \u5e95\u4e0b\u6839\u672c\u4e0d\u53ef\u80fd\u6709 nisuser1 \u7684\u5bb6\u76ee\u5f55\u561b&#xff01;\u90a3\u600e\u529e&#xff1f;\u5f88\u7b80\u5355&#xff0c;\u5c06\u670d\u52a1\u5668\u7aef\u7684 \/home \u6302\u8f7d\u5230\u5ba2\u6237\u7aef\u4e0a\u9762\u5373\u53ef\u554a&#xff01; \u90a3\u8fd9\u4e2a\u89c2\u5ff5\u8ddf\u4e1b\u96c6\u8ba1\u7b97\u673a\u6709\u5565\u5173\u7cfb\u554a&#xff1f;\u5c31\u8ba9\u6211\u4eec\u6765\u8c08\u8c08\u5427&#xff01;<\/span><\/span><\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ec0\u4e48\u662f\u4e1b\u96c6\u8ba1\u7b97\u673a&#xff1f;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u4e3a\u4e2a\u4eba\u8ba1\u7b97\u673a\u7684 CPU \u901f\u5ea6\u8d8a\u6765\u8d8a\u5feb&#xff0c;\u6838\u5fc3\u6570\u76ee\u8d8a\u6765\u8d8a\u591a&#xff0c;\u56e0\u6b64\u4e2a\u4eba\u8ba1\u7b97\u673a\u7684\u6548\u80fd\u5df2\u7ecf\u4e0d\u6bd4\u670d\u52a1\u5668\u7b49\u7ea7\u7684\u5927\u578b\u8ba1\u7b97\u673a\u5dee\u4e86&#xff01; \u4e0d\u8fc7&#xff0c;\u5982\u679c\u8981\u7528\u6765\u4f5c\u4e3a\u8ba1\u7b97\u5927\u578b\u6570\u503c\u6a21\u5f0f\u7684\u5e94\u7528&#xff0c;\u5373\u4f7f\u662f\u6700\u5feb\u7684\u4e2a\u4eba\u8ba1\u7b97\u673a&#xff0c;\u8fd8\u662f\u6ca1\u6709\u529e\u6cd5\u6709\u6548\u7684\u8d1f\u8377\u7684\u3002\u6b64\u65f6\u4f60\u53ef\u80fd\u5c31\u5f97\u8981\u8003\u8651\u4e00\u4e0b&#xff0c; \u662f\u8981\u4e70\u8d85\u7ea7\u8ba1\u7b97\u673a (Top 500) \u8fd8\u662f\u8981\u81ea\u5df1\u7ec4\u4e00\u90e8 PC \u4e1b\u96c6\u8ba1\u7b97\u673a (PC cluster)\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8d85\u7ea7\u8ba1\u7b97\u673a\u7684\u7ed3\u6784\u4e2d&#xff0c;\u4e3b\u8981\u662f\u900f\u8fc7\u5185\u90e8\u7535\u8def\u5c06\u597d\u591a\u9897 CPU \u4e0e\u5185\u5b58\u8fde\u63a5\u5728\u4e00\u5757&#xff0c;\u56e0\u4e3a\u662f\u7279\u6b8a\u8bbe\u8ba1&#xff0c;\u56e0\u6b64\u4ef7\u683c\u975e\u5e38\u6602\u8d35\u3002 \u5982\u679c\u6211\u4eec\u53ef\u4ee5\u5c06\u8f83\u4fbf\u5b9c\u7684\u4e2a\u4eba\u8ba1\u7b97\u673a\u4e32\u63a5\u5728\u4e00\u5757&#xff0c;\u7136\u540e\u5c06\u6570\u503c\u8fd0\u7b97\u7684\u4efb\u52a1\u5206\u522b\u4e22\u7ed9\u6bcf\u4e00\u90e8\u4e32\u63a5\u5728\u4e00\u5757\u7684\u4e2a\u4eba\u8ba1\u7b97\u673a&#xff0c; \u90a3\u4e0d\u5c31\u5f88\u50cf\u8d85\u7ea7\u8ba1\u7b97\u673a\u4e86\u5417&#xff1f;\u6ca1\u9519&#xff01;\u8fd9\u5c31\u662f PC cluster \u6700\u65e9\u7684\u60f3\u6cd5\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f46\u662f\u8fd9\u4e2a\u4f5c\u6cd5\u5f53\u4e2d\u6709\u51e0\u4e2a\u9650\u5236\u5594&#xff0c;\u56e0\u4e3a\u6bcf\u90e8\u8ba1\u7b97\u673a\u90fd\u9700\u8981\u8fd0\u7b97\u76f8\u540c\u7684\u7a0b\u5e8f&#xff0c;\u800c\u6211\u4eec\u77e5\u9053\u8fd0\u7b97\u7684\u6570\u636e\u90fd\u5728\u5185\u5b58\u5f53\u4e2d&#xff0c; \u800c\u7a0b\u5e8f\u542f\u52a8\u65f6\u9700\u8981\u7ed9\u4e88\u4e00\u4e2a\u8eab\u4efd&#xff0c;\u800c\u7a0b\u5e8f\u8bfb\u53d6\u7684\u7a0b\u5e8f\u5728\u6bcf\u90e8\u8ba1\u7b97\u673a\u4e0a\u9762\u90fd\u9700\u8981\u662f\u76f8\u540c\u7684&#xff01;\u540c\u65f6&#xff0c;\u6bcf\u90e8\u8ba1\u7b97\u673a\u90fd\u9700\u8981\u652f\u6301\u5e73\u884c\u5316\u8fd0\u7b97&#xff01; \u6240\u4ee5&#xff0c;\u5728 PC cluster \u4e0a\u9762\u7684\u6240\u6709\u8ba1\u7b97\u673a\u5c31\u5f97\u8981\u6709&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u76f8\u540c\u7684\u7528\u6237\u5e10\u6237\u4fe1\u606f&#xff0c;\u5305\u62ec\u8d26\u53f7\u3001\u5bc6\u7801\u3001\u5bb6\u76ee\u5f55\u7b49\u7b49\u4e00\u5927\u5806\u4fe1\u606f&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u76f8\u540c\u7684\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u4f8b\u5982 \/home, \/var\/spool\/mail \u4ee5\u53ca\u6570\u503c\u7a0b\u5e8f\u653e\u7f6e\u7684\u4f4d\u7f6e<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53ef\u4ee5\u642d\u914d\u7684\u5e73\u884c\u5316\u51fd\u5f0f\u5e93&#xff0c;\u5e38\u89c1\u7684\u6709 MPICH, PVM&#8230;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0a\u9762\u7684\u4e09\u4e2a\u9879\u76ee\u4e2d&#xff0c;\u7b2c\u4e00\u4e2a\u9879\u76ee\u6211\u4eec\u53ef\u4ee5\u900f\u8fc7 NIS \u6765\u5904\u7406&#xff0c;\u7b2c\u4e8c\u4e2a\u9879\u76ee\u5219\u53ef\u4ee5\u4f7f\u7528 NFS \u6765\u641e\u5b9a&#xff5e;\u6240\u4ee5\u5570&#xff0c;\u4f60\u8bf4&#xff0c; NIS \u4e0e NFS \u6709\u6ca1\u6709\u53ef\u4f7f\u7528\u7684\u7a7a\u95f4\u554a&#xff1f; ^_^<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Tips:<span style=\"color:#009000\">\u7531\u4e8e\u300e\u9884\u6d4b\u300f\u8fd9\u4e2a\u73a9\u610f\u513f\u8d8a\u6765\u8d8a\u91cd\u8981&#xff0c;\u6bd4\u5982\u8bf4\u6c14\u8c61\u9884\u62a5\u3001\u7a7a\u6c14\u8d28\u91cf\u9884\u62a5\u7b49\u7b49&#xff0c;\u800c\u9884\u6d4b\u9700\u8981\u4e00\u4e2a\u5f88\u5e9e\u5927\u7684\u6a21\u5f0f\u6765\u8fdb\u884c\u4eff\u771f\u7684\u5de5\u4f5c&#xff0c; \u8fd9\u4e48\u5e9e\u5927\u7684\u6a21\u62df\u5de5\u4f5c\u9700\u8981\u5927\u91cf\u7684\u8fd0\u7b97&#xff0c;\u5728\u5b66\u6821\u5355\u4f4d\u8981\u4e70\u4e00\u90e8\u5f88\u8d35\u7684\u5927\u578b\u4e3b\u673a\u5b9e\u5728\u5f88\u4e0d\u5bb9\u6613&#xff01;\u4e0d\u8fc7&#xff0c;\u5982\u679c\u80fd\u591f\u4e32\u63a5\u5341\u90e8\u56db\u6838\u5fc3\u7684\u4e2a\u4eba\u8ba1\u7b97\u673a\u7684\u8bdd&#xff0c; \u90a3\u4e48\u53ef\u80fd\u53ea\u9700\u8981\u4e0d\u5230 20 \u4e07\u4fbf\u80fd\u591f\u7ec4\u6210\u76f8\u5f53\u4e8e\u5177\u6709 40 \u9897 CPU \u7684\u5927\u578b\u4e3b\u673a\u7684\u8fd0\u7b97\u80fd\u529b\u4e86&#xff01;\u6240\u4ee5\u8bf4&#xff0c;\u5728\u672a\u6765 PC cluster \u662f\u4e00\u4e2a\u53ef\u4ee5\u53d1\u5c55\u7684\u8bfe\u9898\u5594&#xff01;<\/span><\/span><\/span><\/td>\n<td>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u9e1f\u54e5\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061108-68033e7c8dca0.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53e6\u4e00\u4e2a\u4e0d\u6210\u6750\u7684\u5b9e\u4f8b<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u90a3\u6211\u4eec\u6709\u6ca1\u6709\u529e\u6cd5\u6765\u5b9e\u4f5c\u4e00\u4e0b\u5e73\u884c\u5316\u7684\u4e1b\u96c6\u67b6\u6784\u5462&#xff1f;\u8001\u5b9e\u8bf4&#xff0c;\u5f88\u9ebb\u70e6&#xff5e;\u4e0d\u8fc7&#xff0c;\u81f3\u5c11\u6211\u4eec\u53ef\u4ee5\u5148\u5b8c\u6210\u524d\u9762\u8c08\u5230\u7684\u4e24\u4e2a\u7ec4\u4ef6&#xff01; \u5206\u522b\u662f NIS \u4e0e NFS \u561b&#xff01;\u4f46\u662f&#xff0c;\u5728\u6211\u4eec\u76ee\u524d\u8fd9\u4e2a\u7f51\u7edc\u73af\u5883\u4e2d&#xff0c;\u7528\u6237\u8d26\u53f7\u5b9e\u5728\u662f\u592a\u7d0a\u4e71\u4e86&#xff5e;\u6240\u4ee5&#xff0c;\u5982\u679c\u60f3\u8981\u5c06\u670d\u52a1\u5668\u7684 \/home \u6302\u8f7d\u5230\u5ba2\u6237\u7aef\u7684 \/home&#xff0c;\u90a3\u4e48\u90a3\u4e2a\u6d4b\u8bd5\u7528\u7684\u5ba2\u6237\u7aef\u53ef\u80fd\u5f88\u591a\u672c\u5730\u7528\u6237\u90fd\u65e0\u6cd5\u767b\u5165\u4e86&#xff5e;\u56e0\u6b64&#xff0c;\u5728\u8fd9\u4e2a\u6d4b\u8bd5\u7ec3\u4e60\u4e2d&#xff0c; \u6211\u4eec\u6253\u7b97\u8fd9\u6837\u505a&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8d26\u53f7&#xff1a;\u5efa\u7acb\u5927\u4e8e 2000 \u4ee5\u4e0a\u7684\u8d26\u53f7&#xff0c;\u8d26\u53f7\u540d\u79f0\u4e3a cluser1, cluser2, cluser3 (\u5c06 cluster user \u7f29\u5199\u4e3a cluser&#xff0c;\u4e0d\u662f\u5c11\u5199\u4e00\u4e2a t \u5594&#xff01;)&#xff0c;\u4e14\u8fd9\u4e9b\u8d26\u53f7\u7684\u5bb6\u76ee\u5f55\u9884\u8ba1\u653e\u7f6e\u4e8e \/rhome \u76ee\u5f55\u5185&#xff0c;\u4ee5\u4e0e NIS client \u672c\u5730\u7684\u7528\u6237\u5206\u5f00&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u670d\u52a1\u5668&#xff1a;\u9886\u57df\u540d\u4e3a vbirdcluster&#xff0c;\u670d\u52a1\u5668\u662f www.centos.vbird (192.168.100.254)&#xff0c;\u5ba2\u6237\u7aef\u662f clientlinux.centos.vbird (192.168.100.10)&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668&#xff1a;\u670d\u52a1\u5668\u5206\u4eab\u4e86 \/rhome \u7ed9 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u57df&#xff0c;\u4e14\u9884\u8ba1\u5c06\u6240\u6709\u7a0b\u5e8f\u653e\u7f6e\u4e8e \/cluster \u76ee\u5f55\u4e2d\u3002 \u6b64\u5916&#xff0c;\u5047\u8bbe\u6240\u6709\u5ba2\u6237\u7aef\u90fd\u662f\u5f88\u5e72\u51c0\u7684\u7cfb\u7edf&#xff0c;\u56e0\u6b64\u4e0d\u9700\u8981\u538b\u7f29\u5ba2\u6237\u7aef root \u7684\u8eab\u4efd\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u5ba2\u6237\u7aef&#xff1a;\u5c06\u6765\u81ea server \u7684\u6587\u4ef6\u7cfb\u7edf\u90fd\u6302\u8f7d\u5230\u76f8\u540c\u76ee\u5f55\u540d\u79f0\u5e95\u4e0b&#xff01;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u90a3\u5c31\u5206\u522b\u6765\u5b9e\u4f5c\u4e00\u4e0b\u5570&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u5b9e\u4f5c\u9636\u6bb5<\/span><\/span><\/li>\n<\/ul>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\"><span style=\"color:#bbbbbb\"># 1. \u5efa\u7acb\u6b64\u6b21\u4efb\u52a1\u6240\u9700\u8981\u7684\u8d26\u53f7\u6570\u636e&#xff1a;<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">mkdir \/rhome<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 2001 -d \/rhome\/cluser1 cluser1<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 2002 -d \/rhome\/cluser2 cluser2<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 2003 -d \/rhome\/cluser3 cluser3<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin cluser1<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin cluser2<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">echo password | passwd &#8211;stdin cluser3<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u4fee\u6539 NISDOMAIN \u7684\u540d\u79f0<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/sysconfig\/network<\/span><br \/>\nNISDOMAIN&#061;vbirdcluster  <span style=\"color:#777777\">&lt;&#061;&#061;\u91cd\u70b9\u5728\u6539\u8fd9\u4e2a\u9879\u76ee\u5594&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a\u6848\u4f8b\u4e2d&#xff0c;\u4f60\u53ea\u8981\u505a\u5b8c\u4e0a\u8ff0\u7684\u52a8\u4f5c\u5c31\u5373\u5c06\u5b8c\u6210\u4e86&#xff0c;\u5176\u4ed6\u7684\u914d\u7f6e\u6587\u4ef6\u8bf7\u53c2\u8003\u524d\u9762 14.2 \u8282\u6240\u8c08\u5230\u7684\u5404\u4e2a\u5fc5\u8981\u9879\u76ee\u3002 \u63a5\u4e0b\u6765\u5f53\u7136\u5c31\u662f\u91cd\u65b0\u542f\u52a8 ypserv \u4ee5\u53ca\u5236\u4f5c\u6570\u636e\u5e93\u5570&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\"><span style=\"color:#bbbbbb\"># 3. \u5236\u4f5c\u6570\u636e\u5e93\u4ee5\u53ca\u91cd\u65b0\u542f\u52a8\u6240\u9700\u8981\u7684\u670d\u52a1&#xff1a;<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">nisdomainname vbirdcluster<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/ypserv restart<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/yppasswdd restart<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">\/usr\/lib64\/yp\/ypinit -m<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f9d\u5e8f\u4e00\u4e2a\u4e00\u4e2a\u6307\u4ee4\u4e0b\u8fbe&#xff01;\u4e0a\u8ff0\u7684\u8fd9\u56db\u4e2a\u6307\u4ee4\u7a0d\u5fae\u6709\u76f8\u4f9d\u6027\u5173\u7cfb\u7684&#xff01;\u6240\u4ee5\u4e0d\u8981\u9519\u4e71\u4e86\u987a\u5e8f\u5594&#xff01;\u63a5\u4e0b\u6765&#xff0c;\u8bf7\u6362\u5230\u5ba2\u6237\u7aef\u8fdb\u884c&#xff1a;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ee5 setup \u8fdb\u884c NIS \u7684\u8bbe\u5b9a&#xff0c;\u5728\u9886\u57df\u7684\u90e8\u5206\u8bf7\u8f6c\u4e3a vbirdcluster \u624d\u5bf9&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u505a\u5b8c\u540e\u518d\u4ee5 id cluser1 \u786e\u8ba4\u770b\u770b\u3002<\/span><\/span><\/li>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f5c\u6cd5\u592a\u7b80\u5355\u4e86&#xff0c;\u9e1f\u54e5\u8fd9\u91cc\u5c31\u4e0d\u793a\u8303\u5570\u3002<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u7684\u8bbe\u5b9a<\/span><\/span><\/li>\n<\/ul>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\"><span style=\"color:#bbbbbb\"># 1. \u8bbe\u5b9a NFS \u670d\u52a1\u5668\u5f00\u653e\u7684\u8d44\u6e90&#xff1a;<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">mkdir \/cluster<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/exports<\/span><br \/>\n<span style=\"color:#FFFF00\">\/rhome          192.168.100.0\/24(rw,no_root_squash)<br \/>\n\/cluster        192.168.100.0\/24(rw,no_root_squash)<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u91cd\u65b0\u542f\u52a8 NFS \u5570&#xff1a;<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/nfs restart<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">showmount -e localhost<\/span><br \/>\nExport list for localhost:<br \/>\n\/rhome       192.168.100.0\/24<br \/>\n\/cluster     192.168.100.0\/24<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u670d\u52a1\u5668\u7684\u8bbe\u5b9a\u662f\u5f88\u5355\u7eaf\u7684&#xff5e;\u5ba2\u6237\u7aef\u7684\u8bbe\u5b9a\u5f97\u8981\u6ce8\u610f\u5570&#xff01;<\/span><\/span><\/p>\n<table style=\"width:580px\">\n<tbody>\n<tr>\n<td style=\"background-color:#000000\"> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\"><span style=\"color:#bbbbbb\"># 1. \u8bbe\u5b9a NIS Client \u7684 mount \u6570\u636e&#xff01;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mkdir \/rhome \/cluster<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/rhome   \/rhome<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/cluster \/cluster<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5982\u679c\u4e0a\u8ff0\u4e24\u4e2a\u6307\u4ee4\u6ca1\u6709\u95ee\u9898&#xff0c;\u53ef\u4ee5\u5c06\u4ed6\u52a0\u5165 \/etc\/rc.d\/rc.local \u5f53\u4e2d\u554a&#xff01;<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">su &#8211; cluser1<\/span><br \/>\n[cluser1&#064;clientlinux ~]$<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6700\u540e\u4f60\u5e94\u8be5\u5c31\u80fd\u591f\u5728\u5ba2\u6237\u7aef\u4ee5 cluser1 \u767b\u5165\u7cfb\u7edf&#xff01;\u5c31\u8fd9\u4e48\u7b80\u5355\u7684\u5c06\u8d26\u53f7\u4e0e\u6587\u4ef6\u7cfb\u7edf\u540c\u6b65\u505a\u5b8c\u5566&#xff01;\u5982\u679c\u4f60\u771f\u7684\u60f3\u8981\u73a9\u4e00\u4e0b PC Cluster \u7684\u8bdd&#xff0c;\u9e1f\u54e5\u4e5f\u6709\u5199\u8fc7\u4e00\u7bc7\u4e0d\u662f\u5f88\u6210\u719f\u7684 PC cluster \u7b80\u6613\u67b6\u8bbe&#xff0c;\u6709\u5174\u8da3\u7684\u8bdd\u8bf7\u81ea\u884c\u53c2\u8003&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">http:\/\/linux.vbird.org\/linux_server\/0600cluster.php<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.5 \u91cd\u70b9\u56de\u987e<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Network Information Service (NIS) \u4e5f\u53ef\u4ee5\u79f0\u4e3a Sun Yellow Pages (yp)&#xff0c;\u4e3b\u8981\u662f\u8d1f\u8d23\u5728\u7f51\u57df\u5f53\u4e2d\u5e2e\u5fd9 NIS Client \u7aef\u67e5\u5bfb\u8d26\u53f7\u4e0e\u5bc6\u7801\u4ee5\u53ca\u5176\u4ed6\u76f8\u5173\u7f51\u7edc\u53c2\u6570\u7684\u670d\u52a1&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS server \u5176\u5b9e\u5c31\u662f\u63d0\u4f9b\u672c\u8eab\u7684 \/etc\/passwd, \/etc\/shadow, \/etc\/group, \/etc\/hosts \u7b49\u8d26\u53f7\u5bc6\u7801\u6570\u636e&#xff0c;\u4ee5\u53ca\u76f8\u5173\u7684\u7f51\u7edc\u53c2\u6570\u7b49&#xff0c;\u4ee5\u63d0\u4f9b\u7f51\u57df\u5f53\u4e2d NIS Client \u7684\u641c\u5bfb\u4e4b\u7528&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u4e3a server\/client \u67b6\u6784&#xff0c;\u5f53 NIS client \u6709\u8d26\u53f7\u767b\u5165\u9700\u6c42\u65f6&#xff0c;\u8be5\u4e3b\u673a\u4f1a (1)\u5148\u627e\u81ea\u5df1\u7684 \/etc\/passwd, (2)\u518d\u524d\u5f80 NIS server \u641c\u5bfb\u76f8\u5173\u8d26\u53f7\u8d44\u6599\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u4f7f\u7528\u7684\u8f6f\u4ef6\u5c31\u662f yp \u8fd9\u4e2a\u8f6f\u4ef6&#xff0c;\u4e3b\u8981\u5206\u4e3a\u4e24\u90e8\u4efd&#xff0c; ypserv \u7528\u5728 NIS Server&#xff0c;\u81f3\u4e8e ypbind \u4e0e yp-tools \u5219\u7528\u5728 NIS Client \u4e0a\u9762\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3a\u52a0\u5feb NIS \u67e5\u8be2\u7684\u901f\u5ea6&#xff0c;\u56e0\u6b64 NIS server \u4f1a\u5c06\u672c\u673a\u7684\u8d26\u53f7\u6570\u636e\u5236\u6210\u4f20\u8f93\u8f83\u5feb\u7684\u6570\u636e\u5e93\u6863\u6848&#xff0c; \u5e76\u653e\u7f6e\u4e8e \/var\/yp\/(nisdomainname)\/ \u76ee\u5f55\u5f53\u4e2d&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0d\u8bba\u662f NIS \u6216\u8005\u662f NFS \u90fd\u662f\u85c9\u7531 RPC Server \u6240\u542f\u7528\u7684&#xff0c;\u56e0\u6b64\u90fd\u53ef\u4ee5\u4f7f\u7528 rpcinfo \u6765\u67e5\u5bfb NIS \u662f\u5426\u5df2\u7ecf\u542f\u52a8&#xff0c;\u4ee5\u53ca\u8be5 daemon \u662f\u5426\u5df2\u7ecf\u5411 portmapper (RPC server) \u6ce8\u518c\u4e86&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 NIS Server \u7684\u8bbe\u5b9a\u5f53\u4e2d&#xff0c;\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u5c06\u8d26\u53f7\u3001\u5bc6\u7801\u3001\u7f51\u7edc\u53c2\u6570\u7b49 ASCII \u683c\u5f0f\u6863\u6848\u8f6c\u6210\u6570\u636e\u5e93\u6863\u6848 (database file)&#xff0c;\u4ee5\u63d0\u4f9b NIS client \u7684\u67e5\u5bfb&#xff01;\u800c\u542f\u52a8 ASCII \u8f6c\u6210 database \u7684\u7a0b\u5e8f\u53ef\u4ee5\u4f7f\u7528 \/usr\/lib64\/yp\/ypinit -m \u6216\u8005\u5230 \/var\/yp \u5e95\u4e0b\u6267\u884c make \u5747\u53ef\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e NIS \u901a\u5e38\u4f7f\u7528\u4e8e\u5185\u90e8\u7f51\u57df\u5f53\u4e2d&#xff0c;\u56e0\u6b64 \/etc\/hosts \u8fd9\u4e2a\u6863\u6848\u7684\u8bbe\u5b9a\u76f8\u5f53\u91cd\u8981&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u82e5\u60f3\u8ba9\u4f7f\u7528\u8005\u5728\u4efb\u4e00\u90e8 NIS \u7ba1\u8f96\u7684\u4e3b\u673a\u767b\u5165\u90fd\u53ef\u4ee5\u4f7f\u7528\u540c\u4e00\u4efd\u5bb6\u76ee\u5f55&#xff0c;\u5219\u9700\u5f00\u542f NFS \u63d0\u4f9b \/home \u7ed9\u6240\u6709\u7684\u4e3b\u673a\u6302\u8f7d\u4f7f\u7528&#xff1b;<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">14.6 \u672c\u7ae0\u4e60\u9898<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8bf7\u7b80\u5355\u8bf4\u660e NIS server \u7684\u529f\u80fd\u4e0e\u5de5\u4f5c\u6d41\u7a0b<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u5f53\u4f60\u6709\u591a\u90e8\u5177\u6709\u76f8\u540c\u8d26\u53f7\u7684 Linux \u4e3b\u673a\u65f6&#xff0c;\u5373\u53ef\u5229\u7528 NIS \u6240\u63d0\u4f9b\u7684\u670d\u52a1&#xff0c;\u6765\u5229\u7528\u4e00\u90e8 NIS \u4e3b\u673a\u638c\u63a7\u6240\u6709\u7684 linux \u4e3b\u673a\u7684\u767b\u5165\u65f6\u6240\u9700\u67e5\u9605\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\u9a8c\u8bc1\u3002\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/span><\/span><\/span> <\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS Server \u5c06\u81ea\u5df1\u7cfb\u7edf\u5185\u7684 \/etc\/passwd, \/etc\/group, \/etc\/hosts \u7b49\u5236\u4f5c\u6210\u4e3a DBM \u7684\u6570\u636e\u5e93\u683c\u5f0f\u6863\u6848&#xff1b;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS Client \u82e5\u6709\u7528\u6237\u767b\u5165\u7684\u8981\u6c42\u65f6&#xff0c;\u4f1a\u524d\u5f80 NIS Server \u641c\u5bfb\u6570\u636e\u5e93\u91cc\u9762\u7684\u6570\u636e\u505a\u4e3a\u9a8c\u8bc1\u4e4b\u7528\u3002<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u6bcf\u6b21\u66f4\u52a8 NIS Server \u4e0a\u9762\u7684\u7528\u6237\u6570\u636e\u65f6&#xff0c;\u5219 NIS Server \u9700\u8981\u91cd\u65b0\u5236\u4f5c DBM \u6570\u636e\u5e93\u6863\u6848\u624d\u884c&#xff01;<\/span><\/span><\/span><\/li>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8bf7\u7b80\u5355\u8bf4\u660e NIS Server\/client \u7684\u67b6\u6784<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS master\/client \u7684\u7279\u8272\u4e3a&#xff1a;<\/span><\/span><\/span> <\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS Server \u7684 master \u5148\u5c06\u81ea\u5df1\u7684\u8d26\u53f7\u3001\u5bc6\u7801\u76f8\u5173\u6863\u6848\u5236\u4f5c\u6210\u4e3a\u6570\u636e\u5e93\u6863\u6848(database file)&#xff1b;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS Server \u7684 master \u5c06\u81ea\u5df1\u7684\u6570\u636e\u5e93\u6863\u6848\u4f20\u9001\u5230 slave \u4e0a\u9762&#xff1b;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">NIS Server \u7684 slave \u63a5\u6536\u6765\u81ea\u300e\u4fe1\u4efb\u7684 NIS Server master \u4e3b\u673a\u300f\u7684\u6570\u636e\u540e&#xff0c;\u66f4\u65b0\u81ea\u5df1\u7684\u6570\u636e\u5e93&#xff0c;\u4f7f\u81ea\u5df1\u7684\u6570\u636e\u5e93\u4e0e master \u4e3b\u673a\u7684\u6570\u636e\u540c\u6b65&#xff1b;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u7f51\u57df\u5f53\u4e2d\u7684\u6240\u6709 NIS Client \u67e5\u5bfb NIS Server \u65f6&#xff0c;\u4f1a\u627e\u5bfb\u300e\u6700\u5148\u54cd\u5e94\u7684\u90a3\u4e00\u90e8 NIS \u4e3b\u673a\u7684\u6570\u636e\u5e93\u5185\u5bb9\u300f\u3002<\/span><\/span><\/span><\/li>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u67b6\u8bbe slave NIS server \u53ef\u4ee5\u5206\u62c5\u533a\u57df\u5185 NIS \u7684\u5de5\u4f5c&#xff01;<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NIS \u542f\u52a8\u4e4b\u524d\u9700\u8981\u5148\u542f\u52a8\u90a3\u4e2a\u670d\u52a1&#xff0c;\u5426\u5219\u5c31\u65e0\u6cd5\u542f\u52a8\u6210\u529f (\u63d0\u793a&#xff1a;RPC Server)<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u56e0\u4e3a NIS \u662f RPC Server \u7684\u4e00\u79cd&#xff0c;\u6240\u4ee5\u5fc5\u987b\u8981\u542f\u52a8 rpcbind \u8fd9\u4e2a daemon \u624d\u884c&#xff01;<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u7684 NIS \u57df\u540d\u4e3a bird &#xff0c;\u53e6\u5916&#xff0c;\u6211\u4e3b\u673a\u7684 IP \u4e0e\u4e3b\u673a\u540d\u4e3a 192.168.5.1\/bird.nis.org &#xff0c;\u8bf7\u95ee\u8981\u8fd9\u4e9b\u4fe1\u606f\u9700\u8981\u8bbe\u5b9a\u5728 NIS Server \u7684\u54ea\u4e9b\u6863\u6848\u4e4b\u5185&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u57df\u540d\u53ef\u4ee5\u76f4\u63a5\u624b\u52a8\u4e0b\u8fbe\u300e nisdomainname bird \u300f\u4e5f\u53ef\u4ee5\u5199\u5165 \/etc\/sysconfig\/network \u91cc\u9762\u300eNISDOMAIN&#061;bird\u300f&#xff1b; IP \u4e0e \u4e3b\u673a\u540d \u9700\u8981\u5199\u5165\u5728 \/etc\/hosts \u91cc\u9762\u3002<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/etc\/nsswitch.conf \u7684\u529f\u80fd\u4e3a\u4f55&#xff1f;\u5982\u679c\u6211\u60f3\u8981\u8ba9\u5bc6\u7801\u67e5\u5bfb\u5148\u672c\u5730\u7684\u5bc6\u7801\u6587\u4ef6&#xff0c;\u518d\u67e5\u5bfb NIS &#xff0c;\u9700\u8981\u5982\u4f55\u8bbe\u5b9a&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u8be5\u6863\u6848\u7684\u529f\u80fd\u5f88\u591a&#xff0c;\u5728 DNS \u65b9\u9762&#xff0c;\u53ef\u4ee5\u7528\u6765\u51b3\u5b9a\u6b63\u3001\u53cd\u89e3\u7684\u987a\u5e8f&#xff0c;\u81f3\u4e8e\u5bc6\u7801\u5219\u53ef\u4ee5\u7528\u6765\u5224\u65ad\u4f55\u8005\u4e3a\u5148&#xff01;\u5982\u679c\u9700\u8981\u5148\u67e5\u672c\u673a\u518d\u67e5 NIS \u7684\u5bc6\u7801\u65f6&#xff0c;\u9700\u8981\u7684\u53c2\u6570&#xff1a; passwd: files nis shadow: files nis<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u6211\u60f3\u8981\u589e\u52a0\u7f51\u57df\u5f53\u4e2d\u4e00\u4e2a\u65b0\u7684\u8d26\u53f7&#xff1a;newaccount&#xff0c;\u5e76\u4e14\u8fd9\u4e2a newaccount \u53ef\u4ee5\u8ba9 NIS Client \u67e5\u5bfb\u5230\u4ed6\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801&#xff0c;\u9700\u8981\u8fdb\u884c\u54ea\u4e9b\u6b65\u9aa4&#xff1f;<\/span><\/span>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u5148\u767b\u5165 NIS Server \u4ee5 useradd newaccount \u4ee5\u53ca passwd newaccount \u6765\u65b0\u589e\u8d26\u53f7&#xff1b;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u5236\u4f5c\u5bc6\u7801\u6570\u636e\u5e93&#xff1a;\u300e\/usr\/lib64\/yp\/ypinit -m\u300f<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u91cd\u65b0\u542f\u52a8&#xff1a;\u300e\/etc\/rc.d\/init.d\/ypserv restart ; \/etc\/rc.d\/init.d\/yppasswdd restart\u300f\u3002<\/span><\/span><\/span><\/li>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5b9e\u4f5c\u8303\u4f8b\u9898&#xff1a;\u5e95\u4e0b\u662f\u6211\u7684\u7f51\u57df\u53c2\u6570\u7279\u5f81&#xff1a; network\/netmask:192.168.1.0\/255.255.255.0 NIS server : 192.168.1.100 (hostname: server.nis.test) NIS cient: 192.168.1.200 (hostname: client1.nis.test) NIS domain name: nis.test \u5229\u7528\u4e0a\u9762\u7684\u53c2\u6570\u6765\u8bbe\u5b9a NIS \u67b6\u6784&#xff0c;\u8bf7\u4e00\u6b65\u4e00\u6b65\u7684\u5199\u4e0b\u4f60\u7684\u8bbe\u5b9a\u3002<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u8bf7\u81ea\u884c\u53c2\u8003\u672c\u7ae0\u8282\u7684\u5185\u5bb9\u8bbe\u5b9a<\/span><\/span><\/span>\n    <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf30\u6b21\u3002\u8fd9\u4e2a\u65f6\u5019\uff0c\u8ba9\u6211\u4eec\u6362\u4e00\u4e2a\u89d2\u5ea6\u6765\u601d\u8003\uff1a\u5982\u679c\u6211\u8bbe\u8ba1\u4e86\u4e00\u90e8\u4e13\u95e8\u7ba1\u7406\u8d26\u53f7\u4e0e\u5bc6\u7801\u7684\u670d\u52a1\u5668\uff0c\u800c\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u5f53\u6709\u5ba2\u6237\u7aef\u8981\u767b\u5165\u7684\u65f6\u5019\uff0c\u5c31\u5fc5\u987b\u8981\u5230\u8fd9\u90e8\u7ba1\u7406\u5bc6\u7801\u7684\u670d\u52a1\u5668\u6765\u67e5\u5bfb\u7528\u6237\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c \u5982\u6b64\u4e00\u6765\uff0c\u6211\u8981\u7ba1\u7406\u6240\u6709\u7684 Linux \u4e3b\u673a\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c\u53ea\u8981\u5230\u90a3\u90e8\u4e3b\u670d\u52a1\u5668\u4e0a\u9762\u53bb\u8fdb\u884c\u8bbe\u5b9a\u5373\u53ef\uff01\u7531\u4e8e\u300e\u9884\u6d4b\u300f\u8fd9\u4e2a\u73a9\u610f\u513f\u8d8a\u6765\u8d8a\u91cd\u8981\uff0c\u6bd4\u5982\u8bf4\u6c14\u8c61\u9884\u62a5\u3001\u7a7a\u6c14\u8d28\u91cf\u9884\u62a5\u7b49\u7b49\uff0c\u800c\u9884\u6d4b\u9700\u8981\u4e00\u4e2a\u5f88\u5e9e\u5927\u7684\u6a21\u5f0f\u6765\u8fdb\u884c\u4eff\u771f\u7684\u5de5\u4f5c\uff0c \u8fd9\u4e48\u5e9e\u5927\u7684\u6a21\u62df\u5de5\u4f5c\u9700\u8981\u5927\u91cf\u7684\u8fd0\u7b97\uff0c\u5728\u5b66\u6821\u5355\u4f4d\u8981\u4e70\u4e00\u90e8\u5f88\u8d35\u7684\u5927\u578b\u4e3b\u673a\u5b9e\u5728\u5f88\u4e0d\u5bb9\u6613\uff01\u6240\u4ee5\u5570\uff0c\u5728\u8f83\u4e3a\u5927\u578b\u7684\u4f01\u4e1a\u73af\u5883\u5f53\u4e2d\uff0c_nis\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":25914,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[92,995,43,44],"topic":[],"class_list":["post-25918","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-github","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/25918.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf30\u6b21\u3002\u8fd9\u4e2a\u65f6\u5019\uff0c\u8ba9\u6211\u4eec\u6362\u4e00\u4e2a\u89d2\u5ea6\u6765\u601d\u8003\uff1a\u5982\u679c\u6211\u8bbe\u8ba1\u4e86\u4e00\u90e8\u4e13\u95e8\u7ba1\u7406\u8d26\u53f7\u4e0e\u5bc6\u7801\u7684\u670d\u52a1\u5668\uff0c\u800c\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u5f53\u6709\u5ba2\u6237\u7aef\u8981\u767b\u5165\u7684\u65f6\u5019\uff0c\u5c31\u5fc5\u987b\u8981\u5230\u8fd9\u90e8\u7ba1\u7406\u5bc6\u7801\u7684\u670d\u52a1\u5668\u6765\u67e5\u5bfb\u7528\u6237\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c \u5982\u6b64\u4e00\u6765\uff0c\u6211\u8981\u7ba1\u7406\u6240\u6709\u7684 Linux \u4e3b\u673a\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c\u53ea\u8981\u5230\u90a3\u90e8\u4e3b\u670d\u52a1\u5668\u4e0a\u9762\u53bb\u8fdb\u884c\u8bbe\u5b9a\u5373\u53ef\uff01\u7531\u4e8e\u300e\u9884\u6d4b\u300f\u8fd9\u4e2a\u73a9\u610f\u513f\u8d8a\u6765\u8d8a\u91cd\u8981\uff0c\u6bd4\u5982\u8bf4\u6c14\u8c61\u9884\u62a5\u3001\u7a7a\u6c14\u8d28\u91cf\u9884\u62a5\u7b49\u7b49\uff0c\u800c\u9884\u6d4b\u9700\u8981\u4e00\u4e2a\u5f88\u5e9e\u5927\u7684\u6a21\u5f0f\u6765\u8fdb\u884c\u4eff\u771f\u7684\u5de5\u4f5c\uff0c \u8fd9\u4e48\u5e9e\u5927\u7684\u6a21\u62df\u5de5\u4f5c\u9700\u8981\u5927\u91cf\u7684\u8fd0\u7b97\uff0c\u5728\u5b66\u6821\u5355\u4f4d\u8981\u4e70\u4e00\u90e8\u5f88\u8d35\u7684\u5927\u578b\u4e3b\u673a\u5b9e\u5728\u5f88\u4e0d\u5bb9\u6613\uff01\u6240\u4ee5\u5570\uff0c\u5728\u8f83\u4e3a\u5927\u578b\u7684\u4f01\u4e1a\u73af\u5883\u5f53\u4e2d\uff0c_nis\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/25918.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T06:11:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061107-68033e7b765bf.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/25918.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/25918.html\",\"name\":\"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T06:11:09+00:00\",\"dateModified\":\"2025-04-19T06:11:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/25918.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/25918.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/25918.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/25918.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf30\u6b21\u3002\u8fd9\u4e2a\u65f6\u5019\uff0c\u8ba9\u6211\u4eec\u6362\u4e00\u4e2a\u89d2\u5ea6\u6765\u601d\u8003\uff1a\u5982\u679c\u6211\u8bbe\u8ba1\u4e86\u4e00\u90e8\u4e13\u95e8\u7ba1\u7406\u8d26\u53f7\u4e0e\u5bc6\u7801\u7684\u670d\u52a1\u5668\uff0c\u800c\u5176\u4ed6\u7684 Linux \u4e3b\u673a\u5f53\u6709\u5ba2\u6237\u7aef\u8981\u767b\u5165\u7684\u65f6\u5019\uff0c\u5c31\u5fc5\u987b\u8981\u5230\u8fd9\u90e8\u7ba1\u7406\u5bc6\u7801\u7684\u670d\u52a1\u5668\u6765\u67e5\u5bfb\u7528\u6237\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c \u5982\u6b64\u4e00\u6765\uff0c\u6211\u8981\u7ba1\u7406\u6240\u6709\u7684 Linux \u4e3b\u673a\u7684\u8d26\u53f7\u4e0e\u5bc6\u7801\uff0c\u53ea\u8981\u5230\u90a3\u90e8\u4e3b\u670d\u52a1\u5668\u4e0a\u9762\u53bb\u8fdb\u884c\u8bbe\u5b9a\u5373\u53ef\uff01\u7531\u4e8e\u300e\u9884\u6d4b\u300f\u8fd9\u4e2a\u73a9\u610f\u513f\u8d8a\u6765\u8d8a\u91cd\u8981\uff0c\u6bd4\u5982\u8bf4\u6c14\u8c61\u9884\u62a5\u3001\u7a7a\u6c14\u8d28\u91cf\u9884\u62a5\u7b49\u7b49\uff0c\u800c\u9884\u6d4b\u9700\u8981\u4e00\u4e2a\u5f88\u5e9e\u5927\u7684\u6a21\u5f0f\u6765\u8fdb\u884c\u4eff\u771f\u7684\u5de5\u4f5c\uff0c \u8fd9\u4e48\u5e9e\u5927\u7684\u6a21\u62df\u5de5\u4f5c\u9700\u8981\u5927\u91cf\u7684\u8fd0\u7b97\uff0c\u5728\u5b66\u6821\u5355\u4f4d\u8981\u4e70\u4e00\u90e8\u5f88\u8d35\u7684\u5927\u578b\u4e3b\u673a\u5b9e\u5728\u5f88\u4e0d\u5bb9\u6613\uff01\u6240\u4ee5\u5570\uff0c\u5728\u8f83\u4e3a\u5927\u578b\u7684\u4f01\u4e1a\u73af\u5883\u5f53\u4e2d\uff0c_nis\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/25918.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T06:11:09+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419061107-68033e7b765bf.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"16 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/25918.html","url":"https:\/\/www.wsisp.com\/helps\/25918.html","name":"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T06:11:09+00:00","dateModified":"2025-04-19T06:11:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/25918.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/25918.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/25918.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c\u5341\u56db\u7ae0\u3001\u8d26\u53f7\u63a7\u7ba1\uff1a NIS \u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/25918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=25918"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/25918\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/25914"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=25918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=25918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=25918"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=25918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}