{"id":29063,"date":"2025-04-20T05:26:28","date_gmt":"2025-04-19T21:26:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/29063.html"},"modified":"2025-04-20T05:26:28","modified_gmt":"2025-04-19T21:26:28","slug":"%e7%ac%ac%e5%8d%81%e4%b8%89%e7%ab%a0%e3%80%81%e6%96%87%e4%bb%b6%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b9%8b%e4%b8%80%ef%bc%9anfs-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/29063.html","title":{"rendered":"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \u670d\u52a1\u5668"},"content":{"rendered":"<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.1 NFS \u7684\u7531\u6765\u4e0e\u5176\u529f\u80fd<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u8fd9\u4e2a\u85c9\u7531\u7f51\u7edc\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u7684\u670d\u52a1\u5728\u67b6\u8bbe\u7684\u65f6\u5019\u662f\u5f88\u7b80\u5355\u7684&#xff0c;\u4e0d\u8fc7&#xff0c;\u5b83\u6700\u5927\u7684\u95ee\u9898\u5728\u4e8e\u300e\u6743\u9650\u300f\u65b9\u9762\u7684\u6982\u5ff5&#xff01; \u56e0\u4e3a\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u53ef\u80fd\u5fc5\u987b\u8981\u5177\u5907\u76f8\u540c\u7684\u8d26\u53f7\u624d\u80fd\u591f\u5b58\u53d6\u67d0\u4e9b\u76ee\u5f55\u6216\u6863\u6848\u3002 \u53e6\u5916&#xff0c;NFS \u7684\u542f\u52a8\u9700\u8981\u900f\u8fc7\u6240\u8c13\u7684\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC)&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u6211\u4eec\u5e76\u4e0d\u662f\u53ea\u8981\u542f\u52a8 NFS \u5c31\u597d\u4e86&#xff0c; \u8fd8\u9700\u8981\u542f\u52a8 RPC \u8fd9\u4e2a\u670d\u52a1\u624d\u884c\u554a&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u6b64&#xff0c;\u5728\u5f00\u59cb\u8fdb\u884c NFS \u7684\u8bbe\u5b9a\u4e4b\u524d&#xff0c;\u6211\u4eec\u5f97\u5148\u6765\u4e86\u89e3\u4e00\u4e0b&#xff0c;\u4ec0\u4e48\u662f NFS \u5462&#xff1f;\u4e0d\u7136\u8bb2\u4e86\u4e00\u5806\u4e5f\u6ca1\u6709\u7528&#xff0c;\u5bf9\u5427&#xff01; ^_^&#xff01; \u5e95\u4e0b\u5c31\u6765\u8c08\u4e00\u8c08\u4ec0\u4e48\u662f NFS &#xff0c;\u4e14 NFS \u7684\u542f\u52a8\u8fd8\u9700\u8981\u4ec0\u4e48\u6837\u7684\u534f\u8bae\u554a&#xff01;<\/span><\/span> \u00a0<\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212619-680414fb8da10.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.1.1 \u4ec0\u4e48\u662f NFS (Network FileSystem)<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u5c31\u662f\u00a0Network\u00a0FileSystem \u7684\u7f29\u5199&#xff0c;\u6700\u65e9\u4e4b\u524d\u662f\u7531\u00a0Sun\u00a0\u8fd9\u5bb6\u516c\u53f8\u6240\u53d1\u5c55\u51fa\u6765\u7684 (\u6ce81)\u3002 \u5b83\u6700\u5927\u7684\u529f\u80fd\u5c31\u662f<span style=\"color:#000088\">\u53ef\u4ee5\u900f\u8fc7\u7f51\u7edc&#xff0c;\u8ba9\u4e0d\u540c\u7684\u673a\u5668\u3001\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u3001\u53ef\u4ee5\u5f7c\u6b64\u5206\u4eab\u4e2a\u522b\u7684\u6863\u6848 (share files)<\/span>\u3002\u6240\u4ee5&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u7b80\u5355\u7684\u5c06\u4ed6\u770b\u505a\u662f\u4e00\u4e2a\u6587\u4ef6\u670d\u52a1\u5668 (file server) \u5462&#xff01;\u8fd9\u4e2a NFS \u670d\u52a1\u5668\u53ef\u4ee5\u8ba9\u4f60\u7684 PC \u6765\u5c06\u7f51\u7edc\u8fdc\u7a0b\u7684 NFS \u670d\u52a1\u5668\u5206\u4eab\u7684\u76ee\u5f55&#xff0c;\u6302\u8f7d\u5230\u672c\u5730\u7aef\u7684\u673a\u5668\u5f53\u4e2d&#xff0c; \u5728\u672c\u5730\u7aef\u7684\u673a\u5668\u770b\u8d77\u6765&#xff0c;\u90a3\u4e2a<span style=\"color:#000088\">\u8fdc\u7a0b\u4e3b\u673a\u7684\u76ee\u5f55\u5c31\u597d\u50cf\u662f\u81ea\u5df1\u7684\u4e00\u4e2a\u78c1\u76d8\u5206\u533a\u69fd\u4e00\u6837 (partition)&#xff01;\u4f7f\u7528\u4e0a\u9762\u76f8\u5f53\u7684\u4fbf\u5229&#xff01;<\/span><\/span><\/span><\/p>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"NFS \u670d\u52a1\u5668\u5206\u4eab\u76ee\u5f55\u4e0e Client \u6302\u8f7d\u793a\u610f\u56fe\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212619-680414fbef35f.jpg\" width=\"534\" \/><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 13.1-1\u3001NFS \u670d\u52a1\u5668\u5206\u4eab\u76ee\u5f55\u4e0e Client \u6302\u8f7d\u793a\u610f\u56fe<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5c31\u5982\u540c\u4e0a\u9762\u7684\u56fe\u793a\u4e00\u822c&#xff0c;\u5f53\u6211\u4eec\u7684 NFS \u670d\u52a1\u5668\u8bbe\u5b9a\u597d\u4e86\u5206\u4eab\u51fa\u6765\u7684 \/home\/sharefile \u8fd9\u4e2a\u76ee\u5f55\u540e&#xff0c;\u5176\u4ed6\u7684 NFS \u5ba2\u6237\u7aef\u5c31\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u76ee\u5f55\u6302\u8f7d\u5230\u81ea\u5df1\u7cfb\u7edf\u4e0a\u9762\u7684\u67d0\u4e2a\u6302\u8f7d\u70b9 (\u6302\u8f7d\u70b9\u53ef\u4ee5\u81ea\u5b9a\u4e49)&#xff0c;\u4f8b\u5982\u524d\u9762\u56fe\u793a\u4e2d\u7684 NFS client 1 \u4e0e NFS client 2 \u6302\u8f7d\u7684\u76ee\u5f55\u5c31\u4e0d\u76f8\u540c\u3002\u6211\u53ea\u8981\u5728 NFS client 1 \u7cfb\u7edf\u4e2d\u8fdb\u5165 \/home\/data\/sharefile \u5185&#xff0c;\u5c31\u53ef\u4ee5\u770b\u5230 NFS \u670d\u52a1\u5668\u7cfb\u7edf\u5185\u7684 \/home\/sharefile \u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6570\u636e\u4e86 (\u5f53\u7136&#xff0c;\u6743\u9650\u8981\u8db3\u591f\u554a&#xff01;^_^)&#xff01;\u8fd9\u4e2a \/home\/data\/sharefile \u5c31\u597d\u50cf NFS client 1 \u81ea\u5df1\u673a\u5668\u91cc\u9762\u7684\u4e00\u4e2a partition \u5594&#xff01;\u53ea\u8981\u6743\u9650\u5bf9\u4e86&#xff0c;\u90a3\u4e48\u4f60\u53ef\u4ee5\u4f7f\u7528 cp, cd, mv, rm&#8230; \u7b49\u7b49\u78c1\u76d8\u6216\u6863\u6848\u76f8\u5173\u7684\u6307\u4ee4&#xff01;\u771f\u662f\u4ed6 X \u7684\u65b9\u4fbf\u5436&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u597d\u7684&#xff0c;\u65e2\u7136 NFS \u662f\u900f\u8fc7\u7f51\u7edc\u6765\u8fdb\u884c\u6570\u636e\u7684\u4f20\u8f93&#xff0c;\u90a3\u4e48\u7ecf\u7531\u7b2c\u4e8c\u7ae0\u8c08\u5230\u7684 socket pair\u00a0\u7684\u6982\u5ff5\u4f60\u4f1a\u77e5\u9053 NFS \u5e94\u8be5\u4f1a\u4f7f\u7528\u4e00\u4e9b\u57e0\u53e3\u5427&#xff1f;\u90a3\u4e48 NFS \u4f7f\u7528\u54ea\u4e2a\u57e0\u53e3\u6765\u8fdb\u884c\u4f20\u8f93\u5462&#xff1f;\u57fa\u672c\u4e0a NFS \u8fd9\u4e2a\u670d\u52a1\u7684\u57e0\u53e3\u5f00\u5728 2049 &#xff0c;\u4f46\u662f\u7531\u4e8e\u6587\u4ef6\u7cfb\u7edf\u975e\u5e38\u590d\u6742&#xff0c;\u56e0\u6b64 NFS \u8fd8\u6709\u5176\u4ed6\u7684\u7a0b\u5e8f\u53bb\u542f\u52a8\u989d\u5916\u7684\u7aef\u53e3&#xff0c;\u4f46\u8fd9\u4e9b\u989d\u5916\u7684\u7aef\u53e3\u542f\u52a8\u7684\u53f7\u7801\u662f&#xff1f; \u7b54\u6848\u662f&#8230;.\u4e0d\u77e5\u9053&#xff01; &#064;_&#064; &#xff01;<span style=\"color:#000088\">\u56e0\u4e3a\u9884\u8bbe NFS \u7528\u6765\u4f20\u8f93\u7684\u57e0\u53e3\u662f\u968f\u673a\u9009\u62e9\u5c0f\u4e8e 1024 \u4ee5\u4e0b\u7684\u57e0\u53e3\u6765\u4f7f\u7528\u7684<\/span>\u3002\u54a6&#xff01;\u90a3\u5ba2\u6237\u7aef\u600e\u4e48\u77e5\u9053\u4f60\u670d\u52a1\u5668\u7aef\u4f7f\u7528\u90a3\u4e2a\u57e0\u53e3\u554a&#xff1f;\u6b64\u65f6\u5c31\u5f97\u8981\u00a0<span style=\"color:#000088\">\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (Remote Procedure Call, RPC)<\/span>\u00a0\u7684\u534f\u5b9a\u6765\u8f85\u52a9\u5566&#xff01;\u5e95\u4e0b\u6211\u4eec\u5c31\u6765\u8c08\u8c08\u4ec0\u4e48\u662f RPC&#xff1f;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212620-680414fc5b96f.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.1.2 \u4ec0\u4e48\u662f RPC (Remote Procedure Call)<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56e0\u4e3a NFS \u652f\u6301\u7684\u529f\u80fd\u76f8\u5f53\u7684\u591a&#xff0c;\u800c\u4e0d\u540c\u7684\u529f\u80fd\u90fd\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u7a0b\u5e8f\u6765\u542f\u52a8&#xff0c; \u6bcf\u542f\u52a8\u4e00\u4e2a\u529f\u80fd\u5c31\u4f1a\u542f\u7528\u4e00\u4e9b\u7aef\u53e3\u6765\u4f20\u8f93\u6570\u636e&#xff0c;\u56e0\u6b64&#xff0c; NFS \u7684\u529f\u80fd\u6240\u5bf9\u5e94\u7684\u7aef\u53e3\u624d\u6ca1\u6709\u56fa\u5b9a\u4f4f&#xff0c; \u800c\u662f\u968f\u673a\u53d6\u7528\u4e00\u4e9b\u672a\u88ab\u4f7f\u7528\u7684\u5c0f\u4e8e 1024 \u7684\u57e0\u53e3\u6765\u4f5c\u4e3a\u4f20\u8f93\u4e4b\u7528\u3002\u4f46\u5982\u6b64\u4e00\u6765\u53c8\u9020\u6210\u5ba2\u6237\u7aef\u60f3\u8981\u8fde\u4e0a\u670d\u52a1\u5668\u65f6\u7684\u56f0\u6270&#xff0c; \u56e0\u4e3a\u5ba2\u6237\u7aef\u5f97\u8981\u77e5\u9053\u670d\u52a1\u5668\u7aef\u7684\u76f8\u5173\u57e0\u53e3\u624d\u80fd\u591f\u8054\u673a\u5427&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6b64\u65f6\u6211\u4eec\u5c31\u5f97\u9700\u8981\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC) \u7684\u670d\u52a1\u5566&#xff01;<span style=\"color:#000088\">RPC \u6700\u4e3b\u8981\u7684\u529f\u80fd\u5c31\u662f\u5728\u6307\u5b9a\u6bcf\u4e2a NFS \u529f\u80fd\u6240\u5bf9\u5e94\u7684 port number &#xff0c;\u5e76\u4e14\u56de\u62a5\u7ed9\u5ba2\u6237\u7aef&#xff0c;\u8ba9\u5ba2\u6237\u7aef\u53ef\u4ee5\u8fde\u7ed3\u5230\u6b63\u786e\u7684\u57e0\u53e3\u4e0a\u53bb<\/span>\u3002 \u90a3 RPC \u53c8\u662f\u5982\u4f55\u77e5\u9053\u6bcf\u4e2a NFS \u7684\u57e0\u53e3\u5462&#xff1f;\u8fd9\u662f\u56e0\u4e3a<span style=\"color:#000088\">\u5f53\u670d\u52a1\u5668\u5728\u542f\u52a8 NFS \u65f6\u4f1a\u968f\u673a\u53d6\u7528\u6570\u4e2a\u57e0\u53e3&#xff0c;\u5e76\u4e3b\u52a8\u7684\u5411 RPC \u6ce8\u518c&#xff0c;\u56e0\u6b64 RPC \u53ef\u4ee5\u77e5\u9053\u6bcf\u4e2a\u57e0\u53e3\u5bf9\u5e94\u7684 NFS \u529f\u80fd<\/span>&#xff0c;\u7136\u540e RPC \u53c8\u662f\u56fa\u5b9a\u4f7f\u7528 port 111 \u6765\u76d1\u542c\u5ba2\u6237\u7aef\u7684\u9700\u6c42\u5e76\u56de\u62a5\u5ba2\u6237\u7aef\u6b63\u786e\u7684\u57e0\u53e3&#xff0c; \u6240\u4ee5\u5f53\u7136\u53ef\u4ee5\u8ba9 NFS \u7684\u542f\u52a8\u66f4\u4e3a\u8f7b\u677e\u6109\u5feb\u4e86&#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\">\u6240\u4ee5\u4f60\u8981\u6ce8\u610f&#xff0c;\u8981\u542f\u52a8 NFS \u4e4b\u524d&#xff0c;RPC \u5c31\u8981\u5148\u542f\u52a8\u4e86&#xff0c;\u5426\u5219 NFS \u4f1a\u65e0\u6cd5\u5411 RPC \u6ce8\u518c\u3002 \u53e6\u5916&#xff0c;RPC \u82e5\u91cd\u65b0\u542f\u52a8\u65f6&#xff0c;\u539f\u672c\u6ce8\u518c\u7684\u6570\u636e\u4f1a\u4e0d\u89c1&#xff0c;\u56e0\u6b64 RPC \u91cd\u65b0\u542f\u52a8\u540e&#xff0c;\u5b83\u7ba1\u7406\u7684\u6240\u6709\u670d\u52a1\u90fd\u9700\u8981\u91cd\u65b0\u542f\u52a8\u6765\u91cd\u65b0\u5411 RPC \u6ce8\u518c\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\/20250419212620-680414fcbba0e.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"NFS \u4e0e RPC \u670d\u52a1\u53ca\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\u7684\u76f8\u5173\u6027\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212621-680414fd2a455.jpg\" width=\"534\" \/><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 13.1-2\u3001NFS \u4e0e RPC \u670d\u52a1\u53ca\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\u7684\u76f8\u5173\u6027<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u4e0a\u56fe\u6240\u793a&#xff0c;\u5f53\u5ba2\u6237\u7aef\u6709 NFS \u6863\u6848\u5b58\u53d6\u9700\u6c42\u65f6&#xff0c;\u4ed6\u4f1a\u5982\u4f55\u5411\u670d\u52a1\u5668\u7aef\u8981\u6c42\u6570\u636e\u5462&#xff1f;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u4f1a\u5411\u670d\u52a1\u5668\u7aef\u7684 RPC (port 111) \u53d1\u51fa NFS \u6863\u6848\u5b58\u53d6\u529f\u80fd\u7684\u8be2\u95ee\u8981\u6c42&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u670d\u52a1\u5668\u7aef\u627e\u5230\u5bf9\u5e94\u7684\u5df2\u6ce8\u518c\u7684 NFS daemon \u57e0\u53e3\u540e&#xff0c;\u4f1a\u56de\u62a5\u7ed9\u5ba2\u6237\u7aef&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u4e86\u89e3\u6b63\u786e\u7684\u57e0\u53e3\u540e&#xff0c;\u5c31\u53ef\u4ee5\u76f4\u63a5\u4e0e NFS daemon \u6765\u8054\u673a\u3002<\/span><\/span><\/li>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e NFS \u7684\u5404\u9879\u529f\u80fd\u90fd\u5fc5\u987b\u8981\u5411 RPC \u6765\u6ce8\u518c&#xff0c;\u5982\u6b64\u4e00\u6765 RPC \u624d\u80fd\u4e86\u89e3 NFS \u8fd9\u4e2a\u670d\u52a1\u7684\u5404\u9879\u529f\u80fd\u4e4b port number, PID, NFS \u5728\u670d\u52a1\u5668\u6240\u76d1\u542c\u7684 IP \u7b49\u7b49&#xff0c;\u800c\u5ba2\u6237\u7aef\u624d\u80fd\u591f\u900f\u8fc7 RPC \u7684\u8be2\u95ee\u627e\u5230\u6b63\u786e\u5bf9\u5e94\u7684\u57e0\u53e3\u3002 \u4e5f\u5c31\u662f\u8bf4&#xff0c;NFS \u5fc5\u987b\u8981\u6709 RPC \u5b58\u5728\u65f6\u624d\u80fd\u6210\u529f\u7684\u63d0\u4f9b\u670d\u52a1&#xff0c;\u56e0\u6b64\u6211\u4eec\u79f0 NFS \u4e3a RPC server \u7684\u4e00\u79cd\u3002\u4e8b\u5b9e\u4e0a&#xff0c;\u6709\u5f88\u591a\u8fd9\u6837\u7684\u670d\u52a1\u5668\u90fd\u662f\u5411 RPC \u6ce8\u518c\u7684&#xff0c;\u4e3e\u4f8b\u6765\u8bf4&#xff0c;NIS (Network Information Service) \u4e5f\u662f RPC server \u7684\u4e00\u79cd\u5462\u3002\u6b64\u5916&#xff0c;\u7531\u56fe 13.1-2 \u4f60\u4e5f\u4f1a\u77e5\u9053&#xff0c;\u4e0d\u8bba\u662f\u5ba2\u6237\u7aef\u8fd8\u662f\u670d\u52a1\u5668\u7aef&#xff0c;\u8981\u4f7f\u7528 NFS \u65f6&#xff0c;\u4e24\u8005\u90fd\u9700\u8981\u542f\u52a8 RPC \u624d\u884c\u5594&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u66f4\u591a\u7684 NFS \u76f8\u5173\u534f\u8bae\u4fe1\u606f\u4f60\u53ef\u4ee5\u53c2\u8003\u5e95\u4e0b\u7f51\u9875&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">RFC 1094, NFS \u534f\u8bae\u89e3\u91ca\u00a0RFC 1094 &#8211; NFS: Network File System Protocol specification (RFC1094)<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Linux NFS-HOWTO&#xff1a;Linux NFS-HOWTO<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212621-680414fd8871f.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.1.3 NFS \u542f\u52a8\u7684 RPC daemons<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u4eec\u73b0\u5728\u77e5\u9053 NFS \u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u65f6\u5019\u5c31\u5f97\u8981\u5411 RPC \u6ce8\u518c&#xff0c;\u6240\u4ee5 NFS \u670d\u52a1\u5668\u4e5f\u88ab\u79f0\u4e3a RPC server \u4e4b\u4e00\u3002 \u90a3\u4e48 NFS \u670d\u52a1\u5668\u4e3b\u8981\u7684\u4efb\u52a1\u662f\u8fdb\u884c\u6587\u4ef6\u7cfb\u7edf\u7684\u5206\u4eab&#xff0c;\u6587\u4ef6\u7cfb\u7edf\u7684\u5206\u4eab\u5219\u4e0e\u6743\u9650\u6709\u5173\u3002 \u6240\u4ee5 NFS \u670d\u52a1\u5668\u542f\u52a8\u65f6\u81f3\u5c11\u9700\u8981\u4e24\u4e2a daemons &#xff0c;\u4e00\u4e2a\u7ba1\u7406\u5ba2\u6237\u7aef\u662f\u5426\u80fd\u591f\u767b\u5165\u7684\u95ee\u9898&#xff0c; \u4e00\u4e2a\u7ba1\u7406\u5ba2\u6237\u7aef\u80fd\u591f\u53d6\u5f97\u7684\u6743\u9650\u3002\u5982\u679c\u4f60\u8fd8\u60f3\u8981\u7ba1\u7406 quota \u7684\u8bdd&#xff0c;\u90a3\u4e48 NFS \u8fd8\u5f97\u8981\u518d\u52a0\u8f7d\u5176\u4ed6\u7684 RPC \u7a0b\u5e8f\u5c31\u662f\u4e86\u3002\u6211\u4eec\u4ee5\u8f83\u5355\u7eaf\u7684 NFS \u670d\u52a1\u5668\u6765\u8bf4&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">rpc.nfsd<\/span>&#xff1a; \u6700\u4e3b\u8981\u7684 NFS \u670d\u52a1\u5668\u670d\u52a1\u63d0\u4f9b\u5546\u3002\u8fd9\u4e2a daemon \u4e3b\u8981\u7684\u529f\u80fd\u5c31\u662f\u5728\u7ba1\u7406\u5ba2\u6237\u7aef\u662f\u5426\u80fd\u591f\u4f7f\u7528\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u4fe1\u606f\u7b49&#xff0c; \u5176\u4e2d\u8fd8\u5305\u542b\u8fd9\u4e2a\u767b\u5165\u8005\u7684 ID \u7684\u5224\u522b\u5594&#xff01;<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">rpc.mountd<\/span> \u8fd9\u4e2a daemon \u4e3b\u8981\u7684\u529f\u80fd&#xff0c;\u5219\u662f\u5728\u7ba1\u7406 NFS \u7684\u6587\u4ef6\u7cfb\u7edf\u54e9&#xff01;\u5f53\u5ba2\u6237\u7aef\u987a\u5229\u7684\u901a\u8fc7 rpc.nfsd \u800c\u767b\u5165\u670d\u52a1\u5668\u4e4b\u540e&#xff0c;\u5728\u4ed6\u53ef\u4ee5\u4f7f\u7528 NFS \u670d\u52a1\u5668\u63d0\u4f9b\u7684\u6863\u6848\u4e4b\u524d&#xff0c;\u8fd8\u4f1a\u7ecf\u8fc7\u6863\u6848\u6743\u9650 (\u5c31\u662f\u90a3\u4e2a -rwxrwxrwx \u4e0e owner, group \u90a3\u51e0\u4e2a\u6743\u9650\u5566) \u7684\u8ba4\u8bc1\u7a0b\u5e8f&#xff01;\u4ed6\u4f1a\u53bb\u8bfb NFS \u7684\u914d\u7f6e\u6587\u4ef6\u00a0<span style=\"color:#000088\">\/etc\/exports<\/span>\u00a0\u6765\u6bd4\u5bf9\u5ba2\u6237\u7aef\u7684\u6743\u9650&#xff0c;\u5f53\u901a\u8fc7\u8fd9\u4e00\u5173\u4e4b\u540e\u5ba2\u6237\u7aef\u5c31\u53ef\u4ee5\u53d6\u5f97\u4f7f\u7528 NFS \u6863\u6848\u7684\u6743\u9650\u5566&#xff01;(\u6ce8&#xff1a;\u8fd9\u4e2a\u4e5f\u662f\u6211\u4eec\u7528\u6765\u7ba1\u7406 NFS \u5206\u4eab\u4e4b\u76ee\u5f55\u7684\u6743\u9650\u4e0e\u5b89\u5168\u8bbe\u5b9a\u7684\u5730\u65b9\u54e9&#xff01;)<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">rpc.lockd (\u975e\u5fc5\u8981)<\/span> \u8fd9\u4e2a\u73a9\u610f\u513f\u53ef\u4ee5\u7528\u5728\u7ba1\u7406\u6863\u6848\u7684\u9501\u5b9a (lock) \u7528\u9014\u3002\u4e3a\u4f55\u6863\u6848\u9700\u8981\u300e\u9501\u5b9a\u300f\u5462&#xff1f; \u56e0\u4e3a\u65e2\u7136\u5206\u4eab\u7684 NFS \u6863\u6848\u53ef\u4ee5\u8ba9\u5ba2\u6237\u7aef\u4f7f\u7528&#xff0c;\u90a3\u4e48\u5f53\u591a\u4e2a\u5ba2\u6237\u7aef\u540c\u65f6\u5c1d\u8bd5\u5199\u5165\u67d0\u4e2a\u6863\u6848\u65f6&#xff0c; \u5c31\u53ef\u80fd\u5bf9\u4e8e\u8be5\u6863\u6848\u9020\u6210\u4e00\u4e9b\u95ee\u9898\u5566&#xff01;\u8fd9\u4e2a rpc.lockd \u5219\u53ef\u4ee5\u7528\u6765\u514b\u670d\u8fd9\u4e2a\u95ee\u9898\u3002 \u4f46 rpc.lockd \u5fc5\u987b\u8981\u540c\u65f6\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u90fd\u5f00\u542f\u624d\u884c\u5594&#xff01;\u6b64\u5916&#xff0c; rpc.lockd \u4e5f\u5e38\u4e0e rpc.statd \u540c\u65f6\u542f\u7528\u3002<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">rpc.statd (\u975e\u5fc5\u8981)<\/span> \u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u6863\u6848\u7684\u4e00\u81f4\u6027&#xff0c;\u4e0e rpc.lockd \u6709\u5173&#xff01;\u82e5\u53d1\u751f\u56e0\u4e3a\u5ba2\u6237\u7aef\u540c\u65f6\u4f7f\u7528\u540c\u4e00\u6863\u6848\u9020\u6210\u6863\u6848\u53ef\u80fd\u6709\u6240\u635f\u6bc1\u65f6&#xff0c; rpc.statd \u53ef\u4ee5\u7528\u6765\u68c0\u6d4b\u5e76\u5c1d\u8bd5\u56de\u590d\u8be5\u6863\u6848\u3002\u4e0e rpc.lockd \u540c\u6837\u7684&#xff0c;\u8fd9\u4e2a\u529f\u80fd\u5fc5\u987b\u8981\u5728\u670d\u52a1\u5668\u7aef\u4e0e\u5ba2\u6237\u7aef\u90fd\u542f\u52a8\u624d\u4f1a\u751f\u6548\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0a\u8ff0\u8fd9\u51e0\u4e2a RPC \u6240\u9700\u8981\u7684\u7a0b\u5e8f&#xff0c;\u5176\u5b9e\u90fd\u5df2\u7ecf\u5199\u5165\u5230\u4e24\u4e2a\u57fa\u672c\u7684\u670d\u52a1\u542f\u52a8\u811a\u672c\u4e2d\u4e86&#xff0c;\u90a3\u5c31\u662f nfs \u4ee5\u53ca nfslock \u5570&#xff01; \u4ea6\u5373\u662f\u5728 \/etc\/init.d\/nfs, \/etc\/init.d\/nfslock&#xff0c;\u4e0e\u670d\u52a1\u5668\u8f83\u6709\u5173\u7684\u5199\u5165\u5728 nfs \u670d\u52a1\u4e2d&#xff0c;\u800c\u4e0e\u5ba2\u6237\u7aef\u7684 rpc.lockd \u4e4b\u7c7b\u7684&#xff0c;\u5c31\u8bbe\u5b9a\u4e8e nfslock \u670d\u52a1\u4e2d\u3002<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212621-680414fde717b.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.1.4 NFS \u7684\u6863\u6848\u8bbf\u95ee\u6743\u9650<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0d\u77e5\u9053\u4f60\u6709\u6ca1\u6709\u60f3\u8fc7\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u5728\u56fe 13.1-1\u00a0\u7684\u73af\u5883\u4e0b&#xff0c;\u5047\u5982\u6211\u5728 NFS client 1 \u4e0a\u9762\u4ee5 dmtsai \u8fd9\u4e2a\u4f7f\u7528\u8005\u8eab\u4efd\u60f3\u8981\u53bb\u5b58\u53d6 \/home\/data\/sharefile\/ \u8fd9\u4e2a\u6765\u81ea NFS server \u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c; \u8bf7\u95ee NFS server \u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u7cfb\u7edf\u4f1a\u8ba9\u6211\u4ee5\u4ec0\u4e48\u8eab\u4efd\u53bb\u5b58\u53d6&#xff1f;\u662f dmtsai \u8fd8\u662f&#xff1f;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3a\u4ec0\u4e48\u4f1a\u8fd9\u4e48\u95ee\u5462&#xff1f;\u8fd9\u662f<span style=\"color:#000088\">\u56e0\u4e3a NFS \u672c\u8eab\u7684\u670d\u52a1\u5e76\u6ca1\u6709\u8fdb\u884c\u8eab\u4efd\u767b\u5165\u7684\u8bc6\u522b<\/span>&#xff0c; \u6240\u4ee5\u8bf4&#xff0c;\u5f53\u4f60\u5728\u5ba2\u6237\u7aef\u4ee5 dmtsai \u7684\u8eab\u4efd\u60f3\u8981\u5b58\u53d6\u670d\u52a1\u5668\u7aef\u7684\u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c;\u00a0<span style=\"color:#000088\">\u670d\u52a1\u5668\u7aef\u4f1a\u4ee5\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\u8005 UID \u4e0e GID \u7b49\u8eab\u4efd\u6765\u5c1d\u8bd5\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u7684\u6587\u4ef6\u7cfb\u7edf<\/span>\u3002\u8fd9\u65f6\u6709\u4e2a\u6709\u8da3\u7684\u95ee\u9898\u5c31\u4ea7\u751f\u5566&#xff01; \u90a3\u5c31\u662f<span style=\"color:#000088\">\u5982\u679c\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u7684\u4f7f\u7528\u8005\u8eab\u4efd\u5e76\u4e0d\u4e00\u81f4\u600e\u4e48\u529e&#xff1f;<\/span>\u00a0\u6211\u4eec\u4ee5\u5e95\u4e0b\u8fd9\u4e2a\u56fe\u793a\u6765\u8bf4\u660e\u4e00\u4e0b\u597d\u4e86&#xff1a;<\/span><\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"NFS \u7684\u670d\u52a1\u5668\u7aef\u4e0e\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\u8005\u8eab\u4efd\u786e\u8ba4\u673a\u5236\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212622-680414fe507e4.jpg\" width=\"534\" \/><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 13.1-3\u3001NFS \u7684\u670d\u52a1\u5668\u7aef\u4e0e\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\u8005\u8eab\u4efd\u786e\u8ba4\u673a\u5236<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u6211\u4ee5 dmtsai \u8fd9\u4e2a\u4e00\u822c\u8eab\u4efd\u4f7f\u7528\u8005\u8981\u53bb\u5b58\u53d6\u6765\u81ea\u670d\u52a1\u5668\u7aef\u7684\u6863\u6848\u65f6&#xff0c;\u4f60\u8981\u5148\u6ce8\u610f\u5230\u7684\u662f&#xff1a;\u00a0<span style=\"color:#000088\">\u6587\u4ef6\u7cfb\u7edf\u7684 inode \u6240\u8bb0\u5f55\u7684\u5c5e\u6027\u4e3a UID, GID \u800c\u975e\u8d26\u53f7\u4e0e\u7fa4\u7ec4\u540d<\/span>\u3002 \u90a3\u4e00\u822c Linux \u4e3b\u673a\u4f1a\u4e3b\u52a8\u7684\u4ee5\u81ea\u5df1\u7684 \/etc\/passwd, \/etc\/group \u6765\u67e5\u8be2\u5bf9\u5e94\u7684\u4f7f\u7528\u8005\u3001\u7ec4\u540d\u3002 \u6240\u4ee5\u5f53 dmtsai \u8fdb\u5165\u5230\u8be5\u76ee\u5f55\u540e&#xff0c;\u4f1a\u53c2\u7167 NFS client 1 \u7684\u4f7f\u7528\u8005\u4e0e\u7ec4\u540d\u3002 \u4f46\u662f\u7531\u4e8e\u8be5\u76ee\u5f55\u7684\u6863\u6848\u4e3b\u8981\u6765\u81ea NFS server &#xff0c;\u6240\u4ee5\u53ef\u80fd\u5c31\u4f1a\u53d1\u73b0\u51e0\u4e2a\u60c5\u51b5&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">NFS server\/NFS client \u521a\u597d\u6709\u76f8\u540c\u7684\u8d26\u53f7\u4e0e\u7fa4\u7ec4<\/span> \u5219\u6b64\u65f6\u4f7f\u7528\u8005\u53ef\u4ee5\u76f4\u63a5\u4ee5 dmtsai \u7684\u8eab\u4efd\u8fdb\u884c\u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u7cfb\u7edf\u4e4b\u5b58\u53d6\u3002<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">NFS server \u7684 501 \u8fd9\u4e2a UID \u8d26\u53f7\u5bf9\u5e94\u4e3a vbird<\/span> \u82e5 NFS \u670d\u52a1\u5668\u4e0a\u7684 \/etc\/passwd \u91cc\u9762 UID 501 \u7684\u4f7f\u7528\u8005\u540d\u79f0\u4e3a vbird \u65f6&#xff0c; \u5219\u5ba2\u6237\u7aef\u7684 dmtsai \u53ef\u4ee5\u5b58\u53d6\u670d\u52a1\u5668\u7aef\u7684 vbird \u8fd9\u4e2a\u4f7f\u7528\u8005\u7684\u6863\u6848\u5594&#xff01;<span style=\"color:#000088\">\u53ea\u56e0\u4e3a\u4e24\u8005\u5177\u6709\u76f8\u540c\u7684 UID \u800c\u5df2\u3002<\/span>\u8fd9\u5c31\u9020\u6210\u5f88\u5927\u7684\u95ee\u9898\u4e86&#xff01;\u56e0\u4e3a\u6ca1\u6709\u4eba\u53ef\u4ee5\u4fdd\u8bc1\u5ba2\u6237\u7aef\u7684 UID \u6240\u5bf9\u5e94\u7684\u8d26\u53f7\u4f1a\u4e0e\u670d\u52a1\u5668\u7aef\u76f8\u540c&#xff0c; \u90a3\u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u6570\u636e\u4e0d\u5c31\u53ef\u80fd\u4f1a\u88ab\u9519\u8bef\u7684\u4f7f\u7528\u8005\u4e71\u6539&#xff1f;<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">NFS server \u5e76\u6ca1\u6709 501 \u8fd9\u4e2a UID<\/span> \u53e6\u4e00\u4e2a\u6781\u7aef\u7684\u60c5\u51b5\u662f&#xff0c;\u5728\u670d\u52a1\u5668\u7aef\u5e76\u6ca1\u6709 501 \u8fd9\u4e2a UID \u7684\u5b58\u5728&#xff0c;\u5219\u6b64\u65f6 dmtsai \u7684\u8eab\u4efd\u5728\u8be5\u76ee\u5f55\u4e0b\u4f1a\u88ab\u538b\u7f29\u6210\u533f\u540d\u8005&#xff0c; \u4e00\u822c NFS \u7684\u533f\u540d\u8005\u4f1a\u4ee5 UID \u4e3a 65534 \u4e3a\u5176\u4f7f\u7528\u8005&#xff0c;\u65e9\u671f\u7684 Linux distributions \u8fd9\u4e2a 65534 \u7684\u8d26\u53f7\u540d\u79f0\u901a\u5e38\u662f nobody &#xff0c;\u6211\u4eec\u7684 CentOS \u5219\u53d6\u540d\u4e3a nfsnobody \u3002\u4f46\u6709\u65f6\u4e5f\u4f1a\u6709\u7279\u6b8a\u7684\u60c5\u51b5&#xff0c;\u4f8b\u5982\u5728\u670d\u52a1\u5668\u7aef\u5206\u4eab \/tmp \u7684\u60c5\u51b5\u4e0b&#xff0c; dmtsain \u7684\u8eab\u4efd\u8fd8\u662f\u4f1a\u4fdd\u6301 501 \u4f46\u5efa\u7acb\u7684\u5404\u9879\u6570\u636e\u5728\u670d\u52a1\u5668\u7aef\u6765\u770b&#xff0c;\u5c31\u4f1a\u5c5e\u4e8e\u65e0\u62e5\u6709\u8005\u7684\u8d44\u6599\u3002<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u5982\u679c\u4f7f\u7528\u8005\u8eab\u4efd\u662f root \u65f6<\/span> \u6709\u4e2a\u6bd4\u8f83\u7279\u6b8a\u7684\u4f7f\u7528\u8005&#xff0c;\u90a3\u5c31\u662f\u6bcf\u4e2a Linux \u4e3b\u673a\u90fd\u6709\u7684 UID \u4e3a 0 \u7684 root \u3002 \u60f3\u4e00\u60f3&#xff0c;\u5982\u679c\u5ba2\u6237\u7aef\u53ef\u4ee5\u7528 root \u7684\u8eab\u4efd\u53bb\u5b58\u53d6\u670d\u52a1\u5668\u7aef\u7684\u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c;\u90a3\u670d\u52a1\u5668\u7aef\u7684\u6570\u636e\u54ea\u6709\u4ec0\u4e48\u4fdd\u62a4\u6027&#xff1f; \u6240\u4ee5<span style=\"color:#000088\">\u5728\u9884\u8bbe\u7684\u60c5\u51b5\u4e0b&#xff0c; root \u7684\u8eab\u4efd\u4f1a\u88ab\u4e3b\u52a8\u7684\u538b\u7f29\u6210\u4e3a\u533f\u540d\u8005<\/span>\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u603b\u4e4b&#xff0c;\u5ba2\u6237\u7aef\u4f7f\u7528\u8005\u80fd\u505a\u7684\u4e8b\u60c5\u662f\u4e0e UID \u53ca\u5176 GID \u6709\u5173\u7684&#xff0c;\u90a3\u5f53\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u7684 UID \u53ca\u8d26\u53f7\u7684\u5bf9\u5e94\u4e0d\u4e00\u81f4\u65f6&#xff0c; \u53ef\u80fd\u5c31\u4f1a\u9020\u6210\u6587\u4ef6\u7cfb\u7edf\u4f7f\u7528\u4e0a\u7684\u56f0\u6270&#xff0c;\u8fd9\u4e2a\u5c31\u662f NFS \u6587\u4ef6\u7cfb\u7edf\u5728\u4f7f\u7528\u4e0a\u9762\u7684\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u5730\u65b9&#xff01; \u800c\u5728\u4e86\u89e3\u4f7f\u7528\u8005\u8d26\u53f7\u4e0e UID \u53ca\u6587\u4ef6\u7cfb\u7edf\u7684\u5173\u7cfb\u4e4b\u540e&#xff0c;\u8981\u5b9e\u9645\u5728\u5ba2\u6237\u7aef\u4ee5 NFS \u53d6\u7528\u670d\u52a1\u5668\u7aef\u7684\u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c; \u4f60\u8fd8\u5f97\u9700\u8981\u5177\u6709&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u6709\u5f00\u653e\u53ef\u5199\u5165\u7684\u6743\u9650 (\u4e0e \/etc\/exports \u8bbe\u5b9a\u6709\u5173)&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5b9e\u9645\u7684\u6863\u6848\u6743\u9650\u5177\u6709\u53ef\u5199\u5165 (w) \u7684\u6743\u9650\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u4f60\u6ee1\u8db3\u4e86 (1)\u4f7f\u7528\u8005\u8d26\u53f7&#xff0c;\u4ea6\u5373 UID \u7684\u76f8\u5173\u8eab\u4efd&#xff1b; (2)NFS \u670d\u52a1\u5668\u5141\u8bb8\u6709\u5199\u5165\u7684\u6743\u9650&#xff1b; (3)\u6587\u4ef6\u7cfb\u7edf\u786e\u5b9e\u5177\u6709 w \u7684\u6743\u9650\u65f6&#xff0c;\u4f60\u624d\u5177\u6709\u8be5\u6863\u6848\u7684\u53ef\u5199\u5165\u6743\u9650\u5594&#xff01; \u5c24\u5176\u662f\u8eab\u4efd (UID) \u786e\u8ba4\u7684\u73af\u8282\u90e8\u5206&#xff0c;\u6700\u5bb9\u6613\u641e\u9519\u5566&#xff01;\u4e5f\u56e0\u4e3a\u5982\u6b64&#xff0c;\u00a0<span style=\"color:#000088\">\u6240\u4ee5 NFS \u901a\u5e38\u9700\u8981\u4e0e\u00a0NIS (\u5341\u56db\u7ae0)\u00a0\u8fd9\u4e00\u4e2a\u53ef\u4ee5\u786e\u8ba4\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u8eab\u4efd\u4e00\u81f4\u7684\u670d\u52a1\u642d\u914d\u4f7f\u7528&#xff0c;<\/span>\u4ee5\u907f\u514d\u8eab\u4efd\u7684\u9519\u4e71\u554a&#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\">\u8001\u5b9e\u8bf4&#xff0c;\u8fd9\u4e2a\u5c0f\u8282\u7684\u6570\u636e\u6bd4\u8f83\u96be\u61c2&#xff5e;\u5c24\u5176\u662f\u521a\u521a\u63a5\u89e6\u5230 NFS server \u7684\u670b\u53cb\u3002\u56e0\u6b64&#xff0c;\u4f60\u53ef\u4ee5\u5148\u7565\u8fc7 13.1.4 \u8fd9\u4e2a\u5c0f\u8282\u3002 \u4f46\u662f&#xff0c;\u5728\u4f60\u8bfb\u5b8c\u4e0e\u505a\u5b8c\u672c\u7ae0\u540e\u7eed\u6240\u6709\u7684\u5b9e\u4f5c\u4e4b\u540e&#xff0c;\u8bb0\u5f97\u56de\u5230\u8fd9\u4e2a\u5c0f\u8282\u6765\u518d\u67e5\u9605\u4e00\u6b21\u6587\u7ae0\u5185\u5bb9&#xff0c;\u76f8\u4fe1\u4f1a\u6709\u8fdb\u4e00\u6b65\u7684\u8ba4\u8bc6\u7684&#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\/20250419212622-680414feaea2a.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5927\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212623-680414ff1a9f8.jpg\" width=\"534\" \/><\/p>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.2 NFS Server \u7aef\u7684\u8bbe\u5b9a<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u65e2\u7136\u8981\u4f7f\u7528 NFS \u7684\u8bdd&#xff0c;\u5c31\u5f97\u8981\u5b89\u88c5 NFS \u6240\u9700\u8981\u7684\u8f6f\u4ef6\u4e86&#xff01;\u5e95\u4e0b\u8ba9\u6211\u4eec\u67e5\u8be2\u4e00\u4e0b\u7cfb\u7edf\u6709\u65e0\u5b89\u88c5\u6240\u9700\u8981\u7684\u8f6f\u4ef6&#xff0c; NFS \u8f6f\u4ef6\u7684\u67b6\u6784\u4ee5\u53ca\u5982\u4f55\u8bbe\u5b9a NFS \u670d\u52a1\u5668\u5427&#xff01; ^_^<\/span><\/span> \u00a0<\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212623-680414ff7868e.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.1 \u6240\u9700\u8981\u7684\u8f6f\u4ef6<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ee5 CentOS 6.x \u4e3a\u4f8b\u7684\u8bdd&#xff0c;\u8981\u8bbe\u5b9a\u597d NFS \u670d\u52a1\u5668\u6211\u4eec\u5fc5\u987b\u8981\u6709\u4e24\u4e2a\u8f6f\u4ef6\u624d\u884c&#xff0c;\u5206\u522b\u662f&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">RPC \u4e3b\u7a0b\u5e8f&#xff1a;rpcbind<\/span> \u5c31\u5982\u540c\u521a\u521a\u63d0\u7684\u5230&#xff0c;\u6211\u4eec\u7684 NFS \u5176\u5b9e\u53ef\u4ee5\u88ab\u89c6\u4e3a\u4e00\u4e2a RPC \u670d\u52a1&#xff0c;\u800c\u8981\u542f\u52a8\u4efb\u4f55\u4e00\u4e2a RPC \u670d\u52a1\u4e4b\u524d&#xff0c;\u6211\u4eec\u90fd\u9700\u8981\u505a\u597d port \u7684\u5bf9\u5e94 (mapping) \u7684\u5de5\u4f5c\u624d\u884c&#xff0c;\u8fd9\u4e2a\u5de5\u4f5c\u5176\u5b9e\u5c31\u662f\u300e rpcbind \u300f\u8fd9\u4e2a\u670d\u52a1\u6240\u8d1f\u8d23\u7684&#xff01;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u00a0<span style=\"color:#000088\">\u5728\u542f\u52a8\u4efb\u4f55\u4e00\u4e2a RPC \u670d\u52a1\u4e4b\u524d&#xff0c;\u6211\u4eec\u90fd\u9700\u8981\u542f\u52a8 rpcbind \u624d\u884c<\/span>&#xff01; (\u5728 CentOS 5.x \u4ee5\u524d\u8fd9\u4e2a\u8f6f\u4ef6\u79f0\u4e3a portmap&#xff0c;\u5728 CentOS 6.x \u4e4b\u540e\u624d\u79f0\u4e3a rpcbind \u7684&#xff01;)<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">NFS \u4e3b\u7a0b\u5e8f&#xff1a;nfs-utils<\/span> \u5c31\u662f\u63d0\u4f9b rpc.nfsd \u53ca rpc.mountd \u8fd9\u4e24\u4e2a NFS daemons \u4e0e\u5176\u4ed6\u76f8\u5173 documents \u4e0e\u8bf4\u660e\u6587\u4ef6\u3001\u6267\u884c\u6587\u4ef6\u7b49\u7684\u8f6f\u4ef6&#xff01;\u8fd9\u4e2a\u5c31\u662f NFS \u670d\u52a1\u6240\u9700\u8981\u7684\u4e3b\u8981\u8f6f\u4ef6\u5566&#xff01;\u4e00\u5b9a\u8981\u6709\u5594&#xff01;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u597d\u4e86&#xff0c;\u77e5\u9053\u6211\u4eec\u9700\u8981\u8fd9\u4e24\u4e2a\u8f6f\u4ef6\u4e4b\u540e&#xff0c;\u73b0\u5728\u5e72\u561b&#xff1f;\u8d76\u5feb\u53bb\u4f60\u7684\u7cfb\u7edf\u5148\u7528 RPM \u770b\u4e00\u4e0b\u6709\u6ca1\u6709\u8fd9\u4e24\u4e2a\u8f6f\u4ef6\u5566&#xff01; \u6ca1\u6709\u7684\u8bdd\u8d76\u5feb\u7528 RPM \u6216 yum \u53bb\u5b89\u88c5\u5594&#xff01;\u4e0d\u7136\u5c31\u73a9\u4e0d\u4e0b\u53bb\u4e86&#xff01;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f8b\u9898&#xff1a;<\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8bf7\u95ee\u6211\u7684\u4e3b\u673a\u662f\u4ee5 RPM \u4e3a\u5957\u4ef6\u7ba1\u7406\u7684 Linux distribution &#xff0c;\u4f8b\u5982 Red Hat, CentOS \u4e0e SuSE \u7b49\u7248\u672c&#xff0c;\u90a3\u4e48\u6211\u8981\u5982\u4f55\u77e5\u9053\u6211\u7684\u4e3b\u673a\u91cc\u9762\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86 rpcbind \u4e0e nfs \u76f8\u5173\u7684\u8f6f\u4ef6\u5462&#xff1f;<\/span><\/span><br \/>\n       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b54&#xff1a;<\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b80\u5355\u7684\u4f7f\u7528\u300e rpm -qa | grep nfs \u300f\u4e0e\u300e rpm -qa | grep rpcbind \u300f\u5373\u53ef\u77e5\u9053\u5566&#xff01;\u5982\u679c\u6ca1\u6709\u5b89\u88c5\u7684\u8bdd&#xff0c; \u5728 CentOS \u5185\u53ef\u4ee5\u4f7f\u7528\u300e\u00a0yum\u00a0install nfs-utils \u300f\u6765\u5b89\u88c5&#xff01;<\/span><\/span>\n       <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212623-680414ffd6f1b.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.2 NFS \u7684\u8f6f\u4ef6\u7ed3\u6784<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u8fd9\u4e2a\u549a\u549a\u771f\u7684\u662f\u5f88\u7b80\u5355&#xff0c;\u4e0a\u9762\u6211\u4eec\u63d0\u5230\u7684 NFS \u8f6f\u4ef6\u4e2d&#xff0c;\u914d\u7f6e\u6587\u4ef6\u53ea\u6709\u4e00\u4e2a&#xff0c;\u6267\u884c\u6863\u4e5f\u4e0d\u591a&#xff0c; \u8bb0\u5f55\u6587\u4ef6\u4e5f\u4e09\u4e09\u4e24\u4e24\u800c\u5df2\u5436&#xff01;\u8d76\u7d27\u5148\u6765\u770b\u4e00\u770b\u5427&#xff01; ^_^<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/exports<\/span> \u8fd9\u4e2a\u6863\u6848\u5c31\u662f NFS \u7684\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u4e86&#xff01;\u4e0d\u8fc7&#xff0c;\u7cfb\u7edf\u5e76\u6ca1\u6709\u9ed8\u8ba4\u503c&#xff0c;\u6240\u4ee5\u8fd9\u4e2a\u6863\u6848\u300e\u00a0<span style=\"color:#000088\">\u4e0d\u4e00\u5b9a\u4f1a\u5b58\u5728<\/span>\u300f&#xff0c;\u4f60\u53ef\u80fd\u5fc5\u987b\u8981\u4f7f\u7528 vim \u4e3b\u52a8\u7684\u5efa\u7acb\u8d77\u8fd9\u4e2a\u6863\u6848\u5594&#xff01;\u6211\u4eec\u7b49\u4e00\u4e0b\u8981\u8c08\u7684\u8bbe\u5b9a\u4e5f\u4ec5\u53ea\u662f\u8fd9\u4e2a\u6863\u6848\u800c\u5df2\u5436&#xff01;<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">NFS \u6587\u4ef6\u7cfb\u7edf\u7ef4\u62a4\u6307\u4ee4&#xff1a;\/usr\/sbin\/exportfs<\/span> \u8fd9\u4e2a\u662f\u7ef4\u62a4 NFS \u5206\u4eab\u8d44\u6e90\u7684\u6307\u4ee4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u6307\u4ee4\u91cd\u65b0\u5206\u4eab \/etc\/exports \u53d8\u66f4\u7684\u76ee\u5f55\u8d44\u6e90\u3001\u5c06 NFS Server \u5206\u4eab\u7684\u76ee\u5f55\u5378\u9664\u6216\u91cd\u65b0\u5206\u4eab\u7b49\u7b49&#xff0c;\u8fd9\u4e2a\u6307\u4ee4\u662f NFS \u7cfb\u7edf\u91cc\u9762\u76f8\u5f53\u91cd\u8981\u7684\u4e00\u4e2a\u5594&#xff01;\u81f3\u4e8e\u6307\u4ee4\u7684\u7528\u6cd5\u6211\u4eec\u5728\u5e95\u4e0b\u4f1a\u4ecb\u7ecd\u3002<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u5206\u4eab\u8d44\u6e90\u7684\u767b\u5f55\u6863&#xff1a;\/var\/lib\/nfs\/*tab<\/span> \u5728 NFS \u670d\u52a1\u5668\u7684\u767b\u5f55\u6587\u4ef6\u90fd\u653e\u7f6e\u5230 \/var\/lib\/nfs\/ \u76ee\u5f55\u91cc\u9762&#xff0c;\u5728\u8be5\u76ee\u5f55\u4e0b\u6709\u4e24\u4e2a\u6bd4\u8f83\u91cd\u8981\u7684\u767b\u5f55\u6863&#xff0c; \u4e00\u4e2a\u662f etab &#xff0c;\u4e3b\u8981\u8bb0\u5f55\u4e86 NFS \u6240\u5206\u4eab\u51fa\u6765\u7684\u76ee\u5f55\u7684\u5b8c\u6574\u6743\u9650\u8bbe\u5b9a\u503c&#xff1b;\u53e6\u4e00\u4e2a xtab \u5219\u8bb0\u5f55\u66fe\u7ecf\u94fe\u63a5\u5230\u6b64 NFS \u670d\u52a1\u5668\u7684\u76f8\u5173\u5ba2\u6237\u7aef\u6570\u636e\u3002<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u5ba2\u6237\u7aef\u67e5\u8be2\u670d\u52a1\u5668\u5206\u4eab\u8d44\u6e90\u7684\u6307\u4ee4&#xff1a;\/usr\/sbin\/showmount<\/span> \u8fd9\u662f\u53e6\u4e00\u4e2a\u91cd\u8981\u7684 NFS \u6307\u4ee4\u3002exportfs \u662f\u7528\u5728 NFS Server \u7aef&#xff0c;\u800c showmount \u5219\u4e3b\u8981\u7528\u5728 Client \u7aef\u3002\u8fd9\u4e2a showmount \u53ef\u4ee5\u7528\u6765\u5bdf\u770b NFS \u5206\u4eab\u51fa\u6765\u7684\u76ee\u5f55\u8d44\u6e90\u5594&#xff01;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5c31\u8bf4\u4e0d\u96be\u5427&#xff01;\u4e3b\u8981\u5c31\u662f\u8fd9\u51e0\u4e2a\u5570&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212624-6804150046b47.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.3 \/etc\/exports \u914d\u7f6e\u6587\u4ef6\u7684\u8bed\u6cd5\u4e0e\u53c2\u6570<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u5f00\u59cb NFS \u670d\u52a1\u5668\u7684\u8bbe\u5b9a\u4e4b\u524d&#xff0c;\u4f60\u5fc5\u987b\u8981\u4e86\u89e3\u7684\u662f&#xff0c;<span style=\"color:#000088\">NFS \u4f1a\u76f4\u63a5\u4f7f\u7528\u5230\u6838\u5fc3\u529f\u80fd&#xff0c;\u6240\u4ee5\u4f60\u7684\u6838\u5fc3\u5fc5\u987b\u8981\u6709\u652f\u6301 NFS \u624d\u884c\u3002<\/span>\u4e07\u4e00\u5982\u679c\u4f60\u7684\u6838\u5fc3\u7248\u672c\u5c0f\u4e8e 2.2 \u7248&#xff0c;\u6216\u8005\u91cd\u65b0\u81ea\u884c\u7f16\u8bd1\u8fc7\u6838\u5fc3\u7684\u8bdd&#xff0c;\u90a3\u4e48\u5c31\u5f97\u8981\u5f88\u6ce8\u610f\u5566&#xff01;\u56e0\u4e3a\u4f60\u53ef\u80fd\u4f1a\u5fd8\u8bb0\u9009\u62e9 NFS \u7684\u6838\u5fc3\u652f\u6301\u554a&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd8\u597d&#xff0c;\u6211\u4eec CentOS \u6216\u8005\u662f\u5176\u4ed6\u7248\u672c\u7684 Linux &#xff0c;\u9884\u8bbe\u6838\u5fc3\u901a\u5e38\u662f\u652f\u6301 NFS \u529f\u80fd\u7684&#xff0c;\u6240\u4ee5\u4f60\u53ea\u8981\u786e\u8ba4\u4f60\u7684\u6838\u5fc3\u7248\u672c\u662f\u76ee\u524d\u65b0\u7684 2.6.x \u7248&#xff0c;\u5e76\u4e14\u4f7f\u7528\u4f60\u7684 distribution \u6240\u63d0\u4f9b\u7684\u6838\u5fc3&#xff0c;\u90a3\u5e94\u8be5\u5c31\u4e0d\u4f1a\u6709\u95ee\u9898\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\">\u4e0a\u9762\u4f1a\u63d0\u9192\u60a8\u8fd9\u4e2a\u95ee\u9898\u7684\u539f\u56e0\u662f&#xff0c;\u4ee5\u524d\u9e1f\u54e5\u90fd\u5f88\u559c\u6b22\u81ea\u884c\u7f16\u8bd1\u4e00\u4e2a\u7279\u522b\u7684\u6838\u5fc3&#xff0c;\u4f46\u662f\u67d0\u6b21\u7f16\u8bd1\u6838\u5fc3\u65f6&#xff0c;\u5374\u5fd8\u8bb0\u52a0\u4e0a\u4e86 NFS \u7684\u6838\u5fc3\u529f\u80fd&#xff0c;\u7ed3\u679c NFS server \u65e0\u8bba\u5982\u4f55\u4e5f\u641e\u4e0d\u8d77\u6765&#xff5e;\u6700\u540e\u624d\u60f3\u5230\u539f\u6765\u4ffa\u7684\u6838\u5fc3\u662f\u975e\u6b63\u89c4\u7684&#8230;<\/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\/20250419212624-68041500a4eb7.jpg\" width=\"534\" \/><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81f3\u4e8e NFS \u670d\u52a1\u5668\u7684\u67b6\u8bbe\u5b9e\u5728\u5f88\u7b80\u5355&#xff0c;<span style=\"color:#000088\">\u4f60\u53ea\u8981\u7f16\u8f91\u597d\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6 \/etc\/exports \u4e4b\u540e&#xff0c;\u5148\u542f\u52a8 rpcbind (\u82e5\u5df2\u7ecf\u542f\u52a8\u4e86&#xff0c;\u5c31\u4e0d\u8981\u91cd\u65b0\u542f\u52a8)&#xff0c;\u7136\u540e\u518d\u542f\u52a8 nfs &#xff0c;\u4f60\u7684 NFS \u5c31\u6210\u529f\u4e86&#xff01;<\/span>\u00a0\u4e0d\u8fc7\u8fd9\u6837\u7684\u8bbe\u5b9a\u80fd\u5426\u5bf9\u5ba2\u6237\u7aef\u751f\u6548&#xff1f;\u90a3\u5c31\u5f97\u8981\u8003\u8651\u4f60\u6743\u9650\u65b9\u9762\u7684\u8bbe\u5b9a\u80fd\u529b\u4e86\u3002\u5e9f\u8bdd\u5c11\u8bf4&#xff0c;\u6211\u4eec\u5c31\u76f4\u63a5\u6765\u770b\u770b\u90a3\u4e2a \/etc\/exports \u5e94\u8be5\u5982\u4f55\u8bbe\u5b9a\u5427&#xff01;\u67d0\u4e9b distributions \u5e76\u4e0d\u4f1a\u4e3b\u52a8\u63d0\u4f9b \/etc\/exports \u6863\u6848&#xff0c;\u6240\u4ee5\u8bf7\u4f60\u81ea\u884c\u624b\u52a8\u5efa\u7acb\u5b83\u5427\u3002<\/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\/exports<\/span><br \/>\n<span style=\"color:#FFFF00\">\/tmp         192.168.100.0\/24(ro)   localhost(rw)   *.ev.ncku.edu.tw(ro,sync)<\/span><br \/>\n<span style=\"color:#ff6666\">[\u5206\u4eab\u76ee\u5f55]   [\u7b2c\u4e00\u90e8\u4e3b\u673a(\u6743\u9650)]     [\u53ef\u7528\u4e3b\u673a\u540d]    [\u53ef\u7528\u901a\u914d\u7b26]<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f60\u770b\u770b&#xff0c;\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u6709\u591f\u7b80\u5355\u5427&#xff01;\u6bcf\u4e00\u884c\u6700\u524d\u9762\u662f\u8981\u5206\u4eab\u51fa\u6765\u7684\u76ee\u5f55&#xff0c;\u6ce8\u610f\u5594&#xff01;\u662f\u4ee5\u76ee\u5f55\u4e3a\u5355\u4f4d\u554a&#xff01; \u7136\u540e\u8fd9\u4e2a\u76ee\u5f55\u53ef\u4ee5\u4f9d\u7167\u4e0d\u540c\u7684\u6743\u9650\u5206\u4eab\u7ed9\u4e0d\u540c\u7684\u4e3b\u673a&#xff0c;\u50cf\u9e1f\u54e5\u4e0a\u9762\u7684\u4f8b\u5b50\u8bf4\u660e\u662f&#xff1a; \u8981\u5c06 \/tmp \u5206\u522b\u5206\u4eab\u7ed9\u4e09\u4e2a\u4e0d\u540c\u7684\u4e3b\u673a\u6216\u7f51\u57df\u7684\u610f\u601d\u3002\u8bb0\u5f97\u4e3b\u673a\u540e\u9762\u4ee5\u5c0f\u62ec\u53f7 () \u8bbe\u8ba1\u6743\u9650\u53c2\u6570&#xff0c; \u82e5\u6743\u9650\u53c2\u6570\u4e0d\u6b62\u4e00\u4e2a\u65f6&#xff0c;\u5219\u4ee5\u9017\u53f7 (,) \u5206\u5f00\u3002\u4e14\u4e3b\u673a\u540d\u4e0e\u5c0f\u62ec\u53f7\u662f\u8fde\u5728\u4e00\u8d77\u7684\u5594&#xff01;\u5728\u8fd9\u4e2a\u6863\u6848\u5185\u4e5f\u53ef\u4ee5\u5229\u7528 # \u6765\u6279\u6ce8\u5462\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81f3\u4e8e\u4e3b\u673a\u540d\u7684\u8bbe\u5b9a\u4e3b\u8981\u6709\u51e0\u4e2a\u65b9\u5f0f&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53ef\u4ee5\u4f7f\u7528\u5b8c\u6574\u7684 IP \u6216\u8005\u662f\u7f51\u57df&#xff0c;\u4f8b\u5982 192.168.100.10 \u6216 192.168.100.0\/24 &#xff0c;\u6216 192.168.100.0\/255.255.255.0 \u90fd\u53ef\u4ee5\u63a5\u53d7&#xff01;<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e3b\u673a\u540d&#xff0c;\u4f46\u8fd9\u4e2a\u4e3b\u673a\u540d\u5fc5\u987b\u8981\u5728 \/etc\/hosts \u5185&#xff0c;\u6216\u53ef\u4f7f\u7528 DNS \u627e\u5230\u8be5\u540d\u79f0\u624d\u884c\u554a&#xff01;\u53cd\u6b63\u91cd\u70b9\u662f\u53ef\u627e\u5230 IP \u5c31\u662f\u4e86\u3002\u5982\u679c\u662f\u4e3b\u673a\u540d\u7684\u8bdd&#xff0c;\u90a3\u4e48\u4ed6\u53ef\u4ee5\u652f\u6301\u901a\u914d\u7b26&#xff0c;\u4f8b\u5982 * \u6216 ? \u5747\u53ef\u63a5\u53d7\u3002<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81f3\u4e8e\u6743\u9650\u65b9\u9762 (\u5c31\u662f\u5c0f\u62ec\u53f7\u5185\u7684\u53c2\u6570) \u5e38\u89c1\u7684\u53c2\u6570\u5219\u6709&#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\">\u53c2\u6570\u503c<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u5185\u5bb9\u8bf4\u660e<\/span><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rw ro<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8be5\u76ee\u5f55\u5206\u4eab\u7684\u6743\u9650\u662f\u53ef\u64e6\u5199 (read-write) \u6216\u53ea\u8bfb (read-only)&#xff0c;\u4f46\u6700\u7ec8\u80fd\u4e0d\u80fd\u8bfb\u5199&#xff0c;\u8fd8\u662f\u4e0e\u6587\u4ef6\u7cfb\u7edf\u7684 rwx \u53ca\u8eab\u4efd\u6709\u5173\u3002<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">sync async<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">sync \u4ee3\u8868\u6570\u636e\u4f1a\u540c\u6b65\u5199\u5165\u5230\u5185\u5b58\u4e0e\u786c\u76d8\u4e2d&#xff0c;async \u5219\u4ee3\u8868\u6570\u636e\u4f1a\u5148\u6682\u5b58\u4e8e\u5185\u5b58\u5f53\u4e2d&#xff0c;\u800c\u975e\u76f4\u63a5\u5199\u5165\u786c\u76d8&#xff01;<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">no_root_squash root_squash<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u4f7f\u7528 NFS \u6587\u4ef6\u7cfb\u7edf\u7684\u8d26\u53f7\u82e5\u4e3a root \u65f6&#xff0c;\u7cfb\u7edf\u8be5\u5982\u4f55\u5224\u65ad\u8fd9\u4e2a\u8d26\u53f7\u7684\u8eab\u4efd&#xff1f;\u9884\u8bbe\u7684\u60c5\u51b5\u4e0b&#xff0c;\u5ba2\u6237\u7aef root \u7684\u8eab\u4efd\u4f1a\u7531 root_squash \u7684\u8bbe\u5b9a\u538b\u7f29\u6210 nfsnobody&#xff0c; \u5982\u6b64\u5bf9\u670d\u52a1\u5668\u7684\u7cfb\u7edf\u4f1a\u8f83\u6709\u4fdd\u969c\u3002\u4f46\u5982\u679c\u4f60\u60f3\u8981\u5f00\u653e\u5ba2\u6237\u7aef\u4f7f\u7528 root \u8eab\u4efd\u6765\u64cd\u4f5c\u670d\u52a1\u5668\u7684\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u90a3\u4e48\u8fd9\u91cc\u5c31\u5f97\u8981\u5f00 no_root_squash \u624d\u884c&#xff01;<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">all_squash<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0d\u8bba\u767b\u5165 NFS \u7684\u4f7f\u7528\u8005\u8eab\u4efd\u4e3a\u4f55&#xff0c; \u4ed6\u7684\u8eab\u4efd\u90fd\u4f1a\u88ab\u538b\u7f29\u6210\u4e3a\u533f\u540d\u7528\u6237&#xff0c;\u901a\u5e38\u4e5f\u5c31\u662f nobody(nfsnobody) \u5566&#xff01;<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">anonuid anongid<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">anon \u610f\u6307 anonymous (\u533f\u540d\u8005) \u524d\u9762\u5173\u4e8e *_squash \u63d0\u5230\u7684\u533f\u540d\u7528\u6237\u7684 UID \u8bbe\u5b9a\u503c&#xff0c;\u901a\u5e38\u4e3a nobody(nfsnobody)&#xff0c;\u4f46\u662f\u4f60\u53ef\u4ee5\u81ea\u884c\u8bbe\u5b9a\u8fd9\u4e2a UID \u7684\u503c&#xff01;\u5f53\u7136&#xff0c;\u8fd9\u4e2a UID \u5fc5\u9700\u8981\u5b58\u5728\u4e8e\u4f60\u7684 \/etc\/passwd \u5f53\u4e2d&#xff01; anonuid \u6307\u7684\u662f UID \u800c anongid \u5219\u662f\u7fa4\u7ec4\u7684 GID \u5570\u3002<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u662f\u51e0\u4e2a\u6bd4\u8f83\u5e38\u89c1\u7684\u6743\u9650\u53c2\u6570&#xff0c;\u5982\u679c\u4f60\u6709\u5174\u8da3\u73a9\u5176\u4ed6\u7684\u53c2\u6570\u65f6&#xff0c;\u8bf7\u81ea\u884c man exports \u53ef\u4ee5\u53d1\u73b0\u5f88\u591a\u6709\u8da3\u7684\u6570\u636e\u3002 \u63a5\u4e0b\u6765\u6211\u4eec\u5229\u7528\u4e0a\u8ff0\u7684\u51e0\u4e2a\u53c2\u6570\u6765\u5b9e\u9645\u601d\u8003\u4e00\u4e0b\u51e0\u4e2a\u6709\u8da3\u7684\u5c0f\u4e60\u9898&#xff1a;<\/span><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4f8b\u9898\u4e00&#xff1a;\u8ba9 root \u4fdd\u6709 root \u7684\u6743\u9650<\/span><\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u60f3\u5c06 \/tmp \u5206\u4eab\u51fa\u53bb\u7ed9\u5927\u5bb6\u4f7f\u7528&#xff0c;\u7531\u4e8e\u8fd9\u4e2a\u76ee\u5f55\u672c\u6765\u5c31\u662f\u5927\u5bb6\u90fd\u53ef\u4ee5\u8bfb\u5199\u7684&#xff0c;\u56e0\u6b64\u60f3\u8ba9\u6240\u6709\u7684\u4eba\u90fd\u53ef\u4ee5\u5b58\u53d6\u3002\u6b64\u5916&#xff0c;\u6211\u8981\u8ba9 root \u5199\u5165\u7684\u6863\u6848\u8fd8\u662f\u5177\u6709 root \u7684\u6743\u9650&#xff0c;\u90a3\u5982\u4f55\u8bbe\u8ba1\u914d\u7f6e\u6587\u4ef6&#xff1f;<\/span><\/span><br \/>\n       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b54&#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\/exports<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u7528\u6211\u7684 \/tmp &#xff0c;\u7528\u901a\u914d\u7b26\u6765\u5904\u7406\u4e3b\u673a\u540d&#xff0c;\u91cd\u70b9\u5728 no_root_squash<\/span><br \/>\n<span style=\"color:#FFFF00\">\/tmp  *(rw,no_root_squash)<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3b\u673a\u540d\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26&#xff0c;\u4e0a\u5934\u8868\u793a\u65e0\u8bba\u6765\u81ea\u54ea\u91cc\u90fd\u53ef\u4ee5\u4f7f\u7528\u6211\u7684 \/tmp \u8fd9\u4e2a\u76ee\u5f55\u3002 \u518d\u6b21\u63d0\u9192&#xff0c;\u300e *(rw,no_root_squash) \u300f\u8fd9\u4e00\u4e32\u8bbe\u5b9a\u503c\u4e2d\u95f4\u662f\u6ca1\u6709\u7a7a\u683c\u7b26\u7684\u5594&#xff01;\u800c \/tmp \u4e0e *(rw,no_root_squash) \u5219\u662f\u6709\u7a7a\u683c\u7b26\u6765\u9694\u5f00\u7684&#xff01;<span style=\"color:#000088\">\u7279\u522b\u6ce8\u610f\u5230\u90a3\u4e2a no_root_squash \u7684\u529f\u80fd<\/span>&#xff01;\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d&#xff0c;\u5982\u679c\u4f60\u662f\u5ba2\u6237\u7aef&#xff0c;\u800c\u4e14\u4f60\u662f\u4ee5 root \u7684\u8eab\u4efd\u767b\u5165\u4f60\u7684 Linux \u4e3b\u673a&#xff0c;\u90a3\u4e48\u5f53\u4f60 mount \u4e0a\u6211\u8fd9\u90e8\u4e3b\u673a\u7684 \/tmp \u4e4b\u540e&#xff0c;\u4f60\u5728\u8be5 mount \u7684\u76ee\u5f55\u5f53\u4e2d&#xff0c;\u5c06\u5177\u6709\u300eroot \u7684\u6743\u9650&#xff01;\u300f<\/span><\/span>\n       <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4f8b\u9898\u4e8c&#xff1a;\u540c\u4e00\u76ee\u5f55\u9488\u5bf9\u4e0d\u540c\u8303\u56f4\u5f00\u653e\u4e0d\u540c\u6743\u9650<\/span><\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u8981\u5c06\u4e00\u4e2a\u516c\u5171\u7684\u76ee\u5f55 \/home\/public \u516c\u5f00\u51fa\u53bb&#xff0c;\u4f46\u662f\u53ea\u6709\u9650\u5b9a\u6211\u7684\u5c40\u57df\u7f51\u7edc 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u57df\u4e14\u52a0\u5165 vbirdgroup (\u7b2c\u4e00\u7ae0\u7684\u4f8b\u9898\u5efa\u7acb\u7684\u7fa4\u7ec4) \u7684\u7528\u6237\u624d\u80fd\u591f\u8bfb\u5199&#xff0c;\u5176\u4ed6\u6765\u6e90\u5219\u53ea\u80fd\u8bfb\u53d6\u3002<\/span><\/span><br \/>\n       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b54&#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\">mkdir \/home\/public<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">setfacl -m g:vbirdgroup:rwx \/home\/public<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/exports<\/span><br \/>\n\/tmp          *(rw,no_root_squash)<br \/>\n<span style=\"color:#FFFF00\">\/home\/public  192.168.100.0\/24(rw)    *(ro)<\/span><br \/>\n<span style=\"color:#ff6666\"># \u7ee7\u7eed\u7d2f\u52a0\u5728\u540e\u9762&#xff0c;\u6ce8\u610f&#xff0c;\u6211\u6709\u5c06\u4e3b\u673a\u4e0e\u7f51\u57df\u5206\u4e3a\u4e24\u6bb5 (\u7528\u7a7a\u767d\u9694\u5f00) \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\">\u4e0a\u9762\u7684\u4f8b\u5b50\u8bf4\u7684\u662f&#xff0c;\u5f53\u6211\u7684 IP \u662f\u5728 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u6bb5\u7684\u65f6\u5019&#xff0c;\u90a3\u4e48\u5f53\u6211\u5728 Client \u7aef\u6302\u8f7d\u4e86 Server \u7aef\u7684 \/home\/public \u540e&#xff0c;\u9488\u5bf9\u8fd9\u4e2a\u88ab\u6211\u6302\u8f7d\u7684\u76ee\u5f55\u6211\u5c31\u5177\u6709\u53ef\u4ee5\u8bfb\u5199\u7684\u6743\u9650&#xff5e; \u81f3\u4e8e\u5982\u679c\u6211\u4e0d\u662f\u5728\u8fd9\u4e2a\u7f51\u6bb5\u4e4b\u5185&#xff0c;\u90a3\u4e48\u8fd9\u4e2a\u76ee\u5f55\u7684\u6570\u636e\u6211\u5c31\u4ec5\u80fd\u8bfb\u53d6\u800c\u5df2&#xff0c;\u4ea6\u5373\u4e3a\u53ea\u8bfb\u7684\u5c5e\u6027\u5566&#xff01; \u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u901a\u914d\u7b26\u4ec5\u80fd\u7528\u5728\u4e3b\u673a\u540d\u7684\u5206\u8fa8\u4e0a\u9762&#xff0c;<span style=\"color:#000088\">IP \u6216\u7f51\u6bb5\u5c31\u53ea\u80fd\u7528 192.168.100.0\/24 \u7684\u72b6\u51b5&#xff0c; \u4e0d\u53ef\u4ee5\u4f7f\u7528 192.168.100.* \u5594&#xff01;<\/span><\/span><\/span>\n       <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4f8b\u9898\u4e09&#xff1a;\u4ec5\u7ed9\u67d0\u4e2a\u5355\u4e00\u4e3b\u673a\u4f7f\u7528\u7684\u76ee\u5f55\u8bbe\u5b9a<\/span><\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u8981\u5c06\u4e00\u4e2a\u79c1\u4eba\u7684\u76ee\u5f55 \/home\/test \u5f00\u653e\u7ed9 192.168.100.10 \u8fd9\u4e2a Client \u7aef\u7684\u673a\u5668\u6765\u4f7f\u7528\u65f6&#xff0c;\u8be5\u5982\u4f55\u8bbe\u5b9a&#xff1f; \u5047\u8bbe\u4f7f\u7528\u8005\u7684\u8eab\u4efd\u662f dmtsai \u624d\u5177\u6709\u5b8c\u6574\u7684\u6743\u9650\u65f6\u3002<\/span><\/span><br \/>\n       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b54&#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\">mkdir \/home\/test<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">setfacl -m u:dmtsai:rwx \/home\/test<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/exports<\/span><br \/>\n\/tmp          *(rw,no_root_squash)<br \/>\n\/home\/public  192.168.100.0\/24(rw)    *(ro)<br \/>\n<span style=\"color:#FFFF00\">\/home\/test    192.168.100.10(rw)<\/span><br \/>\n<span style=\"color:#ff6666\"># \u53ea\u8981\u8bbe\u5b9a IP \u6b63\u786e\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\">\u8fd9\u6837\u5c31\u8bbe\u5b9a\u5b8c\u6210\u4e86&#xff01;\u800c\u4e14&#xff0c;\u53ea\u6709 192.168.100.10 \u8fd9\u90e8\u673a\u5668\u624d\u80fd\u5bf9 \/home\/test \u8fd9\u4e2a\u76ee\u5f55\u8fdb\u884c\u5b58\u53d6\u5594&#xff01;<\/span><\/span>\n       <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4f8b\u9898\u56db&#xff1a;\u5f00\u653e\u533f\u540d\u767b\u5f55\u7684\u60c5\u51b5<\/span><\/span><\/span> <\/p>\n<p>       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u8981\u8ba9 *.centos.vbird \u7f51\u57df\u7684\u4e3b\u673a&#xff0c;\u767b\u5165\u6211\u7684 NFS \u4e3b\u673a\u65f6&#xff0c;\u53ef\u4ee5\u5b58\u53d6 \/home\/linux &#xff0c;\u4f46\u662f\u4ed6\u4eec\u5b58\u6570\u636e\u7684\u65f6\u5019&#xff0c;\u6211\u5e0c\u671b\u4ed6\u4eec\u7684 UID \u4e0e GID \u90fd\u53d8\u6210 45 \u8fd9\u4e2a\u8eab\u4efd\u7684\u4f7f\u7528\u8005&#xff0c;\u5047\u8bbe\u6211 NFS \u670d\u52a1\u5668\u4e0a\u7684 UID 45 \u4e0e GID 45 \u7684\u7528\u6237\/\u7ec4\u540d\u4e3a nfsanon\u3002<\/span><\/span><br \/>\n       <span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7b54&#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\">groupadd -g 45 nfsanon<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -u 45 -g nfsanon nfsanon<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">mkdir \/home\/linux<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">setfacl -m u:nfsanon:rwx \/home\/linux<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">vim \/etc\/exports<\/span><br \/>\n\/tmp          *(rw,no_root_squash)<br \/>\n\/home\/public  192.168.100.0\/24(rw)    *(ro)<br \/>\n\/home\/test    192.168.100.10(rw)<br \/>\n<span style=\"color:#FFFF00\">\/home\/linux   *.centos.vbird(rw,all_squash,anonuid&#061;45,anongid&#061;45)<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5982\u679c\u8981\u5f00\u653e\u533f\u540d&#xff0c;\u90a3\u4e48\u91cd\u70b9\u662f all_squash&#xff0c;\u5e76\u4e14\u8981\u914d\u5408 anonuid \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\">\u7279\u522b\u6ce8\u610f\u5230\u90a3\u4e2a all_squash \u4e0e anonuid, anongid \u7684\u529f\u80fd&#xff01;\u5982\u6b64\u4e00\u6765&#xff0c;\u5f53 clientlinux.centos.vbird \u767b\u5165\u8fd9\u90e8 NFS \u4e3b\u673a&#xff0c;\u5e76\u4e14\u5728 \/home\/linux \u5199\u5165\u6863\u6848\u65f6&#xff0c;\u8be5\u6863\u6848\u7684\u6240\u6709\u4eba\u4e0e\u6240\u6709\u7fa4\u7ec4&#xff0c;\u5c31\u4f1a\u53d8\u6210 \/etc\/passwd \u91cc\u9762\u5bf9\u5e94\u7684 UID \u4e3a 45 \u7684\u90a3\u4e2a\u8eab\u4efd\u7684\u4f7f\u7528\u8005\u4e86&#xff01;<\/span><\/span>\n       <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e0a\u9762\u56db\u4e2a\u6848\u4f8b\u7684\u6743\u9650\u5982\u679c\u4f9d\u716713.1.4 \u5b58\u53d6\u8bbe\u5b9a\u6743\u9650\u6765\u601d\u8003\u7684\u8bdd&#xff0c; \u90a3\u4e48\u6743\u9650\u4f1a\u662f\u4ec0\u4e48\u60c5\u51b5\u5462&#xff1f;\u8ba9\u6211\u4eec\u6765\u68c0\u67e5\u4e00\u4e0b&#xff1a;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u5177\u6709\u76f8\u540c\u7684 UID \u4e0e\u8d26\u53f7&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5047\u8bbe\u6211\u5728 192.168.100.10 \u767b\u5165\u8fd9\u90e8 NFS (IP \u5047\u8bbe\u4e3a 192.168.100.254) \u670d\u52a1\u5668&#xff0c;\u5e76\u4e14\u6211\u5728 192.168.100.10 \u7684\u8d26\u53f7\u4e3a dmtsai \u8fd9\u4e2a\u8eab\u4efd&#xff0c;\u540c\u65f6&#xff0c;\u5728\u8fd9\u90e8 NFS \u4e0a\u9762\u4e5f\u6709 dmtsai \u8fd9\u4e2a\u8d26\u53f7&#xff0c; \u5e76\u5177\u6709\u76f8\u540c\u7684 UID &#xff0c;\u679c\u771f\u5982\u6b64\u7684\u8bdd&#xff0c;\u90a3\u4e48&#xff1a;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e 192.168.100.254 \u8fd9\u90e8 NFS \u670d\u52a1\u5668\u7684 \/tmp \u6743\u9650\u4e3a -rwxrwxrwt &#xff0c;\u6240\u4ee5\u6211 (dmtsai \u5728 192.168.100.10 \u4e0a\u9762) \u5728 \/tmp \u5e95\u4e0b\u5177\u6709\u5b58\u53d6\u7684\u6743\u9650&#xff0c;\u5e76\u4e14\u5199\u5165\u7684\u6863\u6848\u6240\u6709\u4eba\u4e3a dmtsai &#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 \/home\/public \u5f53\u4e2d&#xff0c;\u7531\u4e8e\u6211\u6709\u8bfb\u5199\u7684\u6743\u9650&#xff0c;\u6240\u4ee5\u5982\u679c\u5728 \/home\/public \u8fd9\u4e2a\u76ee\u5f55\u7684\u6743\u9650\u5bf9\u4e8e dmtsai \u6709\u5f00\u653e\u5199\u5165\u7684\u8bdd&#xff0c;\u90a3\u4e48\u6211\u5c31\u53ef\u4ee5\u8bfb\u5199&#xff0c;\u5e76\u4e14\u6211\u5199\u5165\u7684\u6863\u6848\u6240\u6709\u4eba\u662f dmtsai \u3002\u4f46\u662f\u4e07\u4e00 \/home\/public \u5bf9\u4e8e dmtsai \u8fd9\u4e2a\u4f7f\u7528\u8005\u5e76\u6ca1\u6709\u5f00\u653e\u53ef\u4ee5\u5199\u5165\u7684\u6743\u9650\u65f6&#xff0c; \u90a3\u4e48\u6211\u8fd8\u662f\u6ca1\u6709\u529e\u6cd5\u5199\u5165\u6863\u6848\u5594&#xff01;\u8fd9\u70b9\u8bf7\u7279\u522b\u7559\u610f&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 \/home\/test \u5f53\u4e2d&#xff0c;\u6211\u7684\u6743\u9650\u4e0e \/home\/public \u76f8\u540c\u7684\u72b6\u6001&#xff01;\u8fd8\u9700\u8981 NFS \u670d\u52a1\u5668\u7684 \/home\/test \u5bf9\u4e8e dmtsai \u6709\u5f00\u653e\u6743\u9650&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 \/home\/linux \u5f53\u4e2d\u5c31\u6bd4\u8f83\u9ebb\u70e6&#xff01;\u56e0\u4e3a\u4e0d\u8bba\u4f60\u662f\u4f55\u79cd user &#xff0c;\u4f60\u7684\u8eab\u4efd\u4e00\u5b9a\u4f1a\u88ab\u53d8\u6210 UID&#061;45 \u8fd9\u4e2a\u8d26\u53f7&#xff01;\u6240\u4ee5&#xff0c;\u8fd9\u4e2a\u76ee\u5f55\u5c31\u5fc5\u9700\u8981\u9488\u5bf9 UID &#061; 45 \u7684\u90a3\u4e2a\u8d26\u53f7\u540d\u79f0&#xff0c;\u4fee\u6539\u4ed6\u7684\u6743\u9650\u624d\u884c&#xff01;<\/span><\/span> \u00a0<\/li>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u7684\u8d26\u53f7\u5e76\u672a\u76f8\u540c\u65f6&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5047\u5982\u6211\u5728 192.168.100.10 \u7684\u8eab\u4efd\u4e3a vbird (uid \u4e3a 600)&#xff0c;\u4f46\u662f 192.168.100.254 \u8fd9\u90e8 NFS \u4e3b\u673a\u5374\u6ca1\u6709 uid&#061;600 \u7684\u8d26\u53f7\u65f6&#xff0c;\u60c5\u51b5\u4f1a\u53d8\u6210\u600e\u6837\u5462&#xff1f;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u5728 \/tmp \u5e95\u4e0b\u8fd8\u662f\u53ef\u4ee5\u5199\u5165&#xff0c;\u53ea\u662f\u8be5\u6863\u6848\u7684\u6743\u9650\u4f1a\u4fdd\u6301\u4e3a UID&#061;600 &#xff0c;\u56e0\u6b64\u670d\u52a1\u5668\u7aef\u770b\u8d77\u6765\u5c31\u4f1a\u602a\u602a\u7684&#xff0c; \u56e0\u4e3a\u627e\u4e0d\u5230 UID&#061;600 \u8fd9\u4e2a\u8d26\u53f7\u7684\u663e\u793a&#xff0c;\u6545\u6863\u6848\u62e5\u6709\u8005\u4f1a\u586b\u4e0a 600 \u5466&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u5728 \/home\/public \u91cc\u9762\u662f\u5426\u53ef\u4ee5\u5199\u5165&#xff0c;\u8fd8\u9700\u8981\u89c6 \/home\/public \u7684\u6743\u9650\u800c\u5b9a&#xff0c;\u4e0d\u8fc7&#xff0c;\u7531\u4e8e\u6ca1\u6709\u52a0\u4e0a all_squash \u7684\u53c2\u6570&#xff0c; \u56e0\u6b64\u5728\u8be5\u76ee\u5f55\u4e0b\u4f1a\u4fdd\u7559\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\u8005 UID&#xff0c;\u540c\u4e0a\u4e00\u70b9\u6240\u793a\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/test \u7684\u89c2\u70b9\u4e0e \/home\/public \u76f8\u540c&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/linux \u5e95\u4e0b&#xff0c;\u6211\u7684\u8eab\u4efd\u5c31\u88ab\u53d8\u6210 UID &#061; 45 \u90a3\u4e2a\u4f7f\u7528\u8005\u5c31\u662f\u4e86&#xff01;<\/span><\/span> \u00a0<\/li>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u5ba2\u6237\u7aef\u7684\u8eab\u4efd\u4e3a root \u65f6&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5047\u5982\u6211\u5728 192.168.100.10 \u7684\u8eab\u4efd\u4e3a root \u5462&#xff1f; root \u8fd9\u4e2a\u8d26\u53f7\u6bcf\u4e2a\u7cfb\u7edf\u90fd\u4f1a\u6709\u5440&#xff01;\u6743\u9650\u53d8\u6210\u600e\u6837\u5462&#xff1f;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u5728 \/tmp \u91cc\u9762\u53ef\u4ee5\u5199\u5165&#xff0c;\u5e76\u4e14\u7531\u4e8e no_root_squash \u7684\u53c2\u6570&#xff0c;\u6539\u53d8\u4e86\u9884\u8bbe\u7684 root_squash \u8bbe\u5b9a\u503c&#xff0c;\u6240\u4ee5\u5728 \/tmp \u5199\u5165\u7684\u6863\u6848\u6240\u6709\u4eba\u4e3a root \u5594&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u5728 \/home\/public \u5e95\u4e0b\u7684\u8eab\u4efd\u8fd8\u662f\u88ab\u538b\u7f29\u6210\u4e3a nobody \u4e86&#xff01;\u56e0\u4e3a\u9ed8\u8ba4\u5c5e\u6027\u91cc\u9762\u90fd\u5177\u6709 root_squash \u5462&#xff01;\u6240\u4ee5&#xff0c;\u5982\u679c \/home\/public \u6709\u9488\u5bf9 nobody \u5f00\u653e\u5199\u5165\u6743\u9650\u65f6&#xff0c;\u90a3\u4e48\u6211\u5c31\u53ef\u4ee5\u5199\u5165&#xff0c;\u4f46\u662f\u6863\u6848\u6240\u6709\u4eba\u53d8\u6210 nobody \u5c31\u662f\u4e86&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/test \u4e0e \/home\/public \u76f8\u540c&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/linux \u7684\u60c5\u51b5\u4e2d&#xff0c;\u6211 root \u7684\u8eab\u4efd\u4e5f\u88ab\u538b\u7f29\u6210\u4e3a UID &#061; 45 \u7684\u90a3\u4e2a\u4f7f\u7528\u8005\u4e86&#xff01;<\/span><\/span> \u00a0<\/li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u6837\u7684\u6743\u9650\u8bb2\u89e3\u4e4b\u540e&#xff0c;\u4f60\u53ef\u4ee5\u4e86\u89e3\u4e86\u5417&#xff1f;\u8fd9\u91cc\u662f\u6700\u91cd\u8981\u7684\u5730\u65b9&#xff0c;\u5982\u679c\u8fd9\u4e00\u5173\u901a\u8fc7\u4e86&#xff0c;\u5e95\u4e0b\u7684\u549a\u549a\u5c31\u6ca1\u6709\u95ee\u9898\u5566&#xff01; ^_^&#xff01; \u5728\u4f60\u5c06\u672c\u6587\u8bfb\u5b8c\u540e&#xff0c;\u6700\u597d\u8fd8\u662f\u56de\u523013.1.4 NFS \u7684\u6863\u6848\u8bbf\u95ee\u6743\u9650\u597d\u597d\u7684\u77a7\u4e00\u77a7&#xff0c; \u624d\u80fd\u89e3\u51b3 NFS \u7684\u95ee\u9898\u5594&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212625-680415010f231.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.4 \u542f\u52a8 NFS<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u914d\u7f6e\u6587\u4ef6\u641e\u5b9a\u540e&#xff0c;\u5f53\u7136\u8981\u5f00\u59cb\u6765\u542f\u52a8\u624d\u884c\u554a&#xff01;\u800c\u524d\u9762\u6211\u4eec\u4e5f\u63d0\u5230\u8fc7&#xff0c;NFS \u7684\u542f\u52a8\u8fd8\u9700\u8981 rpcbind \u7684\u534f\u52a9\u624d\u884c\u554a&#xff01; \u6240\u4ee5\u8d76\u7d27\u6765\u542f\u52a8\u5427&#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\">\/etc\/init.d\/rpcbind start<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5982\u679c rpcbind \u672c\u6765\u5c31\u5df2\u7ecf\u5728\u6267\u884c\u4e86&#xff0c;\u90a3\u5c31\u4e0d\u9700\u8981\u542f\u52a8\u554a&#xff01;<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/nfs start<\/span><br \/>\n<span style=\"color:#ff6666\"># \u6709\u65f6\u5019\u67d0\u4e9b distributions \u53ef\u80fd\u4f1a\u51fa\u73b0\u5982\u4e0b\u7684\u8b66\u544a\u8baf\u606f&#xff1a;<\/span><br \/>\nexportfs: \/etc\/exports [3]: No &#039;sync&#039; or &#039;async&#039; option specified<br \/>\nfor export &#034;192.168.100.10:\/home\/test&#034;.<br \/>\n  Assuming default behaviour (&#039;sync&#039;).<br \/>\n<span style=\"color:#ff6666\"># \u4e0a\u9762\u7684\u8b66\u544a\u8baf\u606f\u4ec5\u662f\u5728\u544a\u77e5\u56e0\u4e3a\u6211\u4eec\u6ca1\u6709\u6307\u5b9a sync \u6216 async \u7684\u53c2\u6570&#xff0c;<br \/>\n# \u5219 NFS \u5c06\u9ed8\u8ba4\u4f1a\u4f7f\u7528 sync \u7684\u4fe1\u606f\u800c\u5df2\u3002\u4f60\u53ef\u4ee5\u4e0d\u7406\u4ed6&#xff0c;\u4e5f\u53ef\u4ee5\u52a0\u5165 \/etc\/exports\u3002<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/nfslock start<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chkconfig rpcbind on<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chkconfig nfs on<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chkconfig nfslock 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\">\u90a3\u4e2a rpcbind \u6839\u672c\u5c31\u4e0d\u9700\u8981\u8bbe\u5b9a&#xff01;\u53ea\u8981\u76f4\u63a5\u542f\u52a8\u5b83\u5c31\u53ef\u4ee5\u5566&#xff01;<span style=\"color:#000088\">\u542f\u52a8\u4e4b\u540e&#xff0c;\u4f1a\u51fa\u73b0\u4e00\u4e2a port 111 \u7684 sunrpc \u7684\u670d\u52a1&#xff0c;\u90a3\u5c31\u662f rpcbind \u5566<\/span>&#xff01;\u81f3\u4e8e nfs \u5219\u4f1a\u542f\u52a8\u81f3\u5c11\u4e24\u4e2a\u4ee5\u4e0a\u7684 daemon \u51fa\u73b0&#xff01;\u7136\u540e\u5c31\u5f00\u59cb\u5728\u76d1\u542c Client \u7aef\u7684\u9700\u6c42\u5566&#xff01;\u4f60\u5fc5\u987b\u8981\u5f88\u6ce8\u610f\u5c4f\u5e55\u4e0a\u9762\u7684\u8f93\u51fa\u4fe1\u606f&#xff0c; \u56e0\u4e3a\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u5199\u9519\u7684\u8bdd&#xff0c;\u5c4f\u5e55\u4e0a\u4f1a\u663e\u793a\u51fa\u9519\u8bef\u7684\u5730\u65b9\u5594&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6b64\u5916&#xff0c;\u5982\u679c\u4f60\u60f3\u8981\u589e\u52a0\u4e00\u4e9b NFS \u670d\u52a1\u5668\u7684\u6570\u636e\u4e00\u81f4\u6027\u529f\u80fd\u65f6&#xff0c;\u53ef\u80fd\u9700\u8981\u7528\u5230 rpc.lockd \u53ca rpc.statd \u7b49 RPC \u670d\u52a1&#xff0c; \u90a3\u4e48\u6216\u8bb8\u4f60\u53ef\u4ee5\u589e\u52a0\u4e00\u4e2a\u670d\u52a1&#xff0c;\u90a3\u5c31\u662f nfslock \u5570&#xff01;\u542f\u52a8\u4e4b\u540e&#xff0c;\u8bf7\u8d76\u5feb\u5230 \/var\/log\/messages \u91cc\u9762\u770b\u770b\u6709\u6ca1\u6709\u88ab\u6b63\u786e\u7684\u542f\u52a8\u5462&#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\">tail \/var\/log\/messages<\/span><br \/>\nJul 27 17:10:39 www kernel: Installing knfsd (copyright (C) 1996 okir&#064;monad.swb.de).<br \/>\nJul 27 17:10:54 www kernel: <span style=\"color:#FFFF00\">NFSD<\/span>: Using \/var\/lib\/nfs\/v4recovery as the NFSv4 state<br \/>\nrecovery directory<br \/>\nJul 27 17:10:54 www kernel: <span style=\"color:#FFFF00\">NFSD<\/span>: starting 90-second grace period<br \/>\nJul 27 17:11:32 www <span style=\"color:#FFFF00\">rpc.statd<\/span>[3689]: Version 1.2.2 starting<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u786e\u8ba4\u542f\u52a8\u6ca1\u6709\u95ee\u9898\u4e4b\u540e&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u77a7\u4e00\u77a7\u90a3\u4e48 NFS \u5230\u5e95\u5f00\u4e86\u54ea\u4e9b\u57e0\u53e3&#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\">netstat -tulnp| grep -E &#039;(rpc|nfs)&#039;<\/span><br \/>\nActive Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address  Foreign Address  State   PID\/Program name<br \/>\ntcp        0      0 0.0.0.0:875    0.0.0.0:*        LISTEN  3631\/rpc.rquotad<br \/>\ntcp        0      0 0.0.0.0:111    0.0.0.0:*        LISTEN  3601\/rpcbind<br \/>\ntcp        0      0 0.0.0.0:48470  0.0.0.0:*        LISTEN  3647\/rpc.mountd<br \/>\ntcp        0      0 0.0.0.0:59967  0.0.0.0:*        LISTEN  3689\/rpc.statd<br \/>\ntcp        0      0 0.0.0.0:2049   0.0.0.0:*        LISTEN  &#8211;<br \/>\nudp        0      0 0.0.0.0:875    0.0.0.0:*                3631\/rpc.rquotad<br \/>\nudp        0      0 0.0.0.0:111    0.0.0.0:*                3601\/rpcbind<br \/>\nudp        0      0 0.0.0.0:897    0.0.0.0:*                3689\/rpc.statd<br \/>\nudp        0      0 0.0.0.0:46611  0.0.0.0:*                3647\/rpc.mountd<br \/>\nudp        0      0 0.0.0.0:808    0.0.0.0:*                3601\/rpcbind<br \/>\nudp        0      0 0.0.0.0:46011  0.0.0.0:*                3689\/rpc.statd<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\u770b\u5230\u4e0a\u9762\u5594&#xff01;\u603b\u5171\u4ea7\u751f\u4e86\u597d\u591a\u7684 port \u5594&#xff01;\u771f\u662f\u53ef\u6015&#xff01;\u4e0d\u8fc7\u4e3b\u8981\u7684\u57e0\u53e3\u662f&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rpcbind \u542f\u52a8\u7684 port \u5728 111 &#xff0c;\u540c\u65f6\u542f\u52a8\u5728 UDP \u4e0e TCP&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">nfs \u672c\u8eab\u7684\u670d\u52a1\u542f\u52a8\u5728 port 2049 \u4e0a\u5934&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5176\u4ed6 rpc.* \u670d\u52a1\u542f\u52a8\u7684 port \u5219\u662f\u968f\u673a\u4ea7\u751f\u7684&#xff0c;\u56e0\u6b64\u9700\u5411 port 111 \u6ce8\u518c\u3002<\/span><\/span><\/li>\n<\/ul>\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\">\u597d\u4e86&#xff0c;\u90a3\u6211\u600e\u4e48\u77e5\u9053\u6bcf\u4e2a RPC \u670d\u52a1\u7684\u6ce8\u518c\u72b6\u51b5&#xff1f;\u6ca1\u5173\u7cfb&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 rpcinfo \u6765\u89c2\u5bdf\u7684\u3002<\/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 [IP|hostname]<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">rpcinfo -t|-u  IP|hostname \u7a0b\u5e8f\u540d\u79f0<\/span><br \/>\n<span style=\"color:#ff6666\">\u9009\u9879\u4e0e\u53c2\u6570&#xff1a;<br \/>\n-p &#xff1a;\u9488\u5bf9\u67d0 IP (\u672a\u5199\u5219\u9884\u8bbe\u4e3a\u672c\u673a) \u663e\u793a\u51fa\u6240\u6709\u7684 port \u4e0e porgram \u7684\u4fe1\u606f&#xff1b;<br \/>\n-t &#xff1a;\u9488\u5bf9\u67d0\u4e3b\u673a\u7684\u67d0\u652f\u7a0b\u5e8f\u68c0\u67e5\u5176 TCP \u5c01\u5305\u6240\u5728\u7684\u8f6f\u4ef6\u7248\u672c&#xff1b;<br \/>\n-u &#xff1a;\u9488\u5bf9\u67d0\u4e3b\u673a\u7684\u67d0\u652f\u7a0b\u5e8f\u68c0\u67e5\u5176 UDP \u5c01\u5305\u6240\u5728\u7684\u8f6f\u4ef6\u7248\u672c&#xff1b;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 1. \u663e\u793a\u51fa\u76ee\u524d\u8fd9\u90e8\u4e3b\u673a\u7684 RPC \u72b6\u6001<\/span><br \/>\n[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    3   tcp    111  portmapper<br \/>\n    100000    2   tcp    111  portmapper<br \/>\n    100000    4   udp    111  portmapper<br \/>\n    100000    3   udp    111  portmapper<br \/>\n    100000    2   udp    111  portmapper<br \/>\n    100011    1   udp    875  rquotad<br \/>\n    100011    2   udp    875  rquotad<br \/>\n    100011    1   tcp    875  rquotad<br \/>\n    100011    2   tcp    875  rquotad<br \/>\n    100003    2   tcp   2049  nfs<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u5e95\u4e0b\u7701\u7565)&#8230;.<\/span><br \/>\n<span style=\"color:#ff6666\"># \u7a0b\u5e8f\u4ee3\u53f7 NFS\u7248\u672c \u5c01\u5305\u7c7b\u578b \u57e0\u53e3  \u670d\u52a1\u540d\u79f0<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u9488\u5bf9 nfs \u8fd9\u4e2a\u7a0b\u5e8f\u68c0\u67e5\u5176\u76f8\u5173\u7684\u8f6f\u4ef6\u7248\u672c\u4fe1\u606f (\u4ec5\u5bdf\u770b TCP \u5c01\u5305)<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">rpcinfo -t localhost nfs<\/span><br \/>\nprogram 100003 version 2 ready and waiting<br \/>\nprogram 100003 version 3 ready and waiting<br \/>\nprogram 100003 version 4 ready and waiting<br \/>\n<span style=\"color:#ff6666\"># \u53ef\u53d1\u73b0\u63d0\u4f9b nfs \u7684\u7248\u672c\u5171\u6709\u4e09\u79cd&#xff0c;\u5206\u522b\u662f 2, 3, 4 \u7248\u5466&#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\">\u4ed4\u7ec6\u77a7\u77a7&#xff0c;\u4e0a\u9762\u51fa\u73b0\u7684\u4fe1\u606f\u5f53\u4e2d\u9664\u4e86\u7a0b\u5e8f\u540d\u79f0\u4e0e\u57e0\u53e3\u7684\u5bf9\u5e94\u53ef\u4ee5\u4e0e netstat -tlunp \u8f93\u51fa\u7684\u7ed3\u679c\u4f5c\u6bd4\u5bf9\u4e4b\u5916&#xff0c;\u8fd8\u9700\u8981\u6ce8\u610f\u5230 NFS \u7684\u7248\u672c\u652f\u6301&#xff01;\u65b0\u7684 NFS \u7248\u672c\u4f20\u8f93\u901f\u5ea6\u8f83\u5feb&#xff0c;\u7531\u4e0a\u8868\u770b\u8d77\u6765&#xff0c;\u6211\u4eec\u7684 NFS \u81f3\u5c11\u652f\u6301\u5230\u7b2c 4 \u7248&#xff0c;\u5e94\u8be5\u8fd8\u7b97\u5408\u7406\u5566&#xff01; ^_^&#xff01;\u00a0<span style=\"color:#000088\">\u5982\u679c\u4f60\u7684 rpcinfo \u65e0\u6cd5\u8f93\u51fa&#xff0c;\u90a3\u5c31\u8868\u793a\u6ce8\u518c\u7684\u6570\u636e\u6709\u95ee\u9898\u5566&#xff01;\u53ef\u80fd\u9700\u8981\u91cd\u65b0\u542f\u52a8 rpcbind \u4e0e nfs \u5594&#xff01;<\/span><\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212625-680415016d888.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.5 NFS \u7684\u8054\u673a\u89c2\u5bdf<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u4f60\u7684 NFS \u670d\u52a1\u5668\u8bbe\u5b9a\u59a5\u5f53\u4e4b\u540e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5728 server \u7aef\u5148\u81ea\u6211\u6d4b\u8bd5\u4e00\u4e0b\u662f\u5426\u53ef\u4ee5\u8054\u673a\u5594&#xff01;\u5c31\u662f\u5229\u7528 showmount \u8fd9\u4e2a\u6307\u4ee4\u6765\u67e5\u9605&#xff01;<\/span><\/span><\/p>\n<p>  <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/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\">showmount [-ae] [hostname|IP]<\/span><br \/>\n<span style=\"color:#ff6666\">\u9009\u9879\u4e0e\u53c2\u6570&#xff1a;<br \/>\n-a &#xff1a;\u663e\u793a\u76ee\u524d\u4e3b\u673a\u4e0e\u5ba2\u6237\u7aef\u7684 NFS \u8054\u673a\u5206\u4eab\u7684\u72b6\u6001&#xff1b;<br \/>\n-e &#xff1a;\u663e\u793a\u67d0\u90e8\u4e3b\u673a\u7684 \/etc\/exports \u6240\u5206\u4eab\u7684\u76ee\u5f55\u6570\u636e\u3002<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 1. \u8bf7\u663e\u793a\u51fa\u521a\u521a\u6211\u4eec\u6240\u8bbe\u5b9a\u597d\u7684\u76f8\u5173 exports \u5206\u4eab\u76ee\u5f55\u4fe1\u606f<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">showmount -e localhost<\/span><br \/>\nExport list for localhost:<br \/>\n\/tmp         *<br \/>\n\/home\/linux  *.centos.vbird<br \/>\n\/home\/test   192.168.100.10<br \/>\n\/home\/public (everyone)<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f88\u7b80\u5355\u5427&#xff01;\u6240\u4ee5&#xff0c;\u5f53\u4f60\u8981\u626b\u7784\u67d0\u4e00\u90e8\u4e3b\u673a\u4ed6\u63d0\u4f9b\u7684 NFS \u5206\u4eab\u7684\u76ee\u5f55\u65f6&#xff0c;\u5c31\u4f7f\u7528 showmount -e IP (\u6216hostname) \u5373\u53ef&#xff01;\u975e\u5e38\u7684\u65b9\u4fbf\u5427&#xff01;\u8fd9\u4e5f\u662f NFS client \u7aef\u6700\u5e38\u7528\u7684\u6307\u4ee4\u5594&#xff01;\u00a0\u53e6\u5916&#xff0c; NFS \u5173\u4e8e\u76ee\u5f55\u6743\u9650\u8bbe\u5b9a\u7684\u6570\u636e\u975e\u5e38\u4e4b\u591a&#xff01;\u5728 \/etc\/exports \u53ea\u662f\u6bd4\u8f83\u7279\u522b\u7684\u6743\u9650\u53c2\u6570\u800c\u5df2&#xff0c;\u8fd8\u6709\u5f88\u591a\u9884\u8bbe\u53c2\u6570\u5462&#xff01; \u8fd9\u4e9b\u9884\u8bbe\u53c2\u6570\u5728\u54ea&#xff1f;\u6211\u4eec\u53ef\u4ee5\u68c0\u67e5\u4e00\u4e0b \/var\/lib\/nfs\/etab \u5c31\u77e5\u9053\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\">[root&#064;www ~]# <span style=\"color:#FFFF00\">tail \/var\/lib\/nfs\/etab<\/span><br \/>\n\/home\/public    192.168.100.0\/24(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,<br \/>\nno_all_squash,no_subtree_check,secure_locks,acl,anonuid&#061;65534,anongid&#061;65534)<br \/>\n<span style=\"color:#ff6666\"># \u4e0a\u9762\u662f\u540c\u4e00\u884c&#xff0c;\u53ef\u4ee5\u770b\u51fa\u9664\u4e86 rw, sync, root_squash \u7b49\u7b49&#xff0c;<br \/>\n# \u5176\u5b9e\u8fd8\u6709 anonuid \u53ca anongid \u7b49\u7b49\u7684\u8bbe\u5b9a&#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\">\u4e0a\u9762\u4ec5\u4ec5\u662f\u4e00\u4e2a\u5c0f\u8303\u4f8b&#xff0c;\u900f\u8fc7\u5206\u6790 anonuid&#061;65534 \u5bf9\u6bd4 \/etc\/passwd \u540e&#xff0c;\u4f1a\u53d1\u73b0 CentOS \u51fa\u73b0\u7684\u662f nfsnobody \u5566&#xff01;\u8fd9\u4e2a\u8d26\u53f7\u5728\u4e0d\u540c\u7684\u7248\u672c\u90fd\u53ef\u80fd\u4f1a\u4e0d\u4e00\u6837\u7684&#xff01;\u53e6\u5916&#xff0c;<span style=\"color:#000088\">\u5982\u679c\u6709\u5176\u4ed6\u5ba2\u6237\u7aef\u6302\u8f7d\u4e86\u4f60\u7684 NFS \u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c;\u90a3\u4e48\u8be5\u5ba2\u6237\u7aef\u4e0e\u6587\u4ef6\u7cfb\u7edf\u4fe1\u606f\u5c31\u4f1a\u88ab\u8bb0\u5f55\u5230 \/var\/lib\/nfs\/xtab \u91cc\u5934\u53bb\u7684<\/span>&#xff01;<\/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\">\u53e6\u5916&#xff0c;\u5982\u679c\u4f60\u60f3\u8981\u91cd\u65b0\u5904\u7406 \/etc\/exports \u6863\u6848&#xff0c;\u5f53\u91cd\u65b0\u8bbe\u5b9a\u5b8c \/etc\/exports \u540e\u9700\u4e0d\u9700\u8981\u91cd\u65b0\u542f\u52a8 nfs &#xff1f; \u4e0d\u9700\u8981\u5566&#xff01;\u5982\u679c\u91cd\u65b0\u542f\u52a8 nfs \u7684\u8bdd&#xff0c;\u8981\u5f97\u518d\u5411 RPC \u6ce8\u518c&#xff01;\u5f88\u9ebb\u70e6&#xff5e;\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u900f\u8fc7 exportfs \u8fd9\u4e2a\u6307\u4ee4\u6765\u5e2e\u5fd9\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\">exportfs [-aruv]<\/span><br \/>\n<span style=\"color:#ff6666\">\u9009\u9879\u4e0e\u53c2\u6570&#xff1a;<br \/>\n-a &#xff1a;\u5168\u90e8\u6302\u8f7d(\u6216\u5378\u9664) \/etc\/exports \u6863\u6848\u5185\u7684\u8bbe\u5b9a<br \/>\n-r &#xff1a;\u91cd\u65b0\u6302\u8f7d \/etc\/exports \u91cc\u9762\u7684\u8bbe\u5b9a&#xff0c;\u6b64\u5916&#xff0c;\u4ea6\u540c\u6b65\u66f4\u65b0 \/etc\/exports<br \/>\n     \u53ca \/var\/lib\/nfs\/xtab \u7684\u5185\u5bb9&#xff01;<br \/>\n-u &#xff1a;\u5378\u9664\u67d0\u4e00\u76ee\u5f55<br \/>\n-v &#xff1a;\u5728 export \u7684\u65f6\u5019&#xff0c;\u5c06\u5206\u4eab\u7684\u76ee\u5f55\u663e\u793a\u5230\u5c4f\u5e55\u4e0a&#xff01;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 1. \u91cd\u65b0\u6302\u8f7d\u4e00\u6b21 \/etc\/exports \u7684\u8bbe\u5b9a<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">exportfs -arv<\/span><br \/>\nexporting 192.168.100.10:\/home\/test<br \/>\nexporting 192.168.100.0\/24:\/home\/public<br \/>\nexporting *.centos.vbird:\/home\/linux<br \/>\nexporting *:\/home\/public<br \/>\nexporting *:\/tmp<\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u5c06\u5df2\u7ecf\u5206\u4eab\u7684 NFS \u76ee\u5f55\u8d44\u6e90&#xff0c;\u901a\u901a\u90fd\u5378\u9664<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">exportfs -auv<\/span><br \/>\n<span style=\"color:#ff6666\"># \u8fd9\u65f6\u5982\u679c\u4f60\u518d\u4f7f\u7528 showmount -e localhost \u5c31\u4f1a\u770b\u4e0d\u5230\u4efb\u4f55\u8d44\u6e90\u4e86&#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\">\u8981\u719f\u6089\u4e00\u4e0b\u8fd9\u4e2a\u6307\u4ee4\u7684\u7528\u6cd5\u5594&#xff01;\u8fd9\u6837\u4e00\u6765&#xff0c;\u5c31\u53ef\u4ee5\u76f4\u63a5\u91cd\u65b0 exportfs \u6211\u4eec\u7684\u8bb0\u5f55\u5728 \/etc\/exports \u7684\u76ee\u5f55\u6570\u636e\u5570&#xff01;\u4f46\u662f\u8981\u7279\u522b\u7559\u610f&#xff0c;\u5982\u679c\u4f60\u4ec5\u6709\u5904\u7406\u914d\u7f6e\u6587\u4ef6&#xff0c;\u4f46\u5e76\u6ca1\u6709\u76f8\u5bf9\u5e94\u7684\u76ee\u5f55 (\/home\/public \u7b49\u76ee\u5f55) \u53ef\u4ee5\u63d0\u4f9b\u4f7f\u7528\u554a&#xff01; \u90a3\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u8b66\u544a\u8baf\u606f\u5594&#xff01;\u6240\u4ee5\u8bb0\u5f97\u8981\u5efa\u7acb\u5206\u4eab\u7684\u76ee\u5f55\u624d\u5bf9&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212625-68041501cc27a.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.2.6 NFS \u7684\u5b89\u5168\u6027<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 NFS \u7684\u5b89\u5168\u6027\u4e0a\u9762&#xff0c;\u6709\u4e9b\u5730\u65b9\u662f\u4f60\u5fc5\u987b\u8981\u77e5\u9053\u7684\u5594&#xff01;\u5e95\u4e0b\u6211\u4eec\u5206\u522b\u6765\u8c08\u4e00\u8c08&#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\">\u9632\u706b\u5899\u7684\u8bbe\u5b9a\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e00\u822c\u6765\u8bf4&#xff0c; NFS \u7684\u670d\u52a1\u4ec5\u4f1a\u5bf9\u5185\u90e8\u7f51\u57df\u5f00\u653e&#xff0c;\u4e0d\u4f1a\u5bf9\u56e0\u7279\u7f51\u5f00\u653e\u7684\u3002\u7136\u800c&#xff0c;\u5982\u679c\u4f60\u6709\u7279\u6b8a\u9700\u6c42\u7684\u8bdd&#xff0c; \u90a3\u4e48\u4e5f\u53ef\u80fd\u4f1a\u8de8\u4e0d\u540c\u7f51\u57df\u5c31\u662f\u4e86\u3002\u4f46\u662f&#xff0c;NFS \u7684\u9632\u706b\u5899\u7279\u522b\u96be\u641e&#xff0c;\u4e3a\u4ec0\u4e48\u5462&#xff1f;\u56e0\u4e3a\u9664\u4e86\u56fa\u5b9a\u7684 port 111, 2049 \u4e4b\u5916&#xff0c; \u8fd8\u6709\u5f88\u591a\u4e0d\u56fa\u5b9a\u7684\u57e0\u53e3\u662f\u7531 rpc.mountd, rpc.rquotad \u7b49\u670d\u52a1\u6240\u5f00\u542f\u7684&#xff0c;\u6240\u4ee5&#xff0c;\u4f60\u7684 iptables \u5c31\u5f88\u96be\u8bbe\u5b9a\u89c4\u5219&#xff01; \u90a3\u600e\u529e&#xff1f;\u96be\u9053\u6574\u4e2a\u9632\u706b\u5899\u673a\u5236\u90fd\u8981\u53d6\u6d88\u624d\u53ef\u4ee5&#xff1f;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c; CentOS 6.x \u6709\u63d0\u4f9b\u4e00\u4e2a\u56fa\u5b9a\u7279\u5b9a NFS \u670d\u52a1\u7684\u57e0\u53e3\u914d\u7f6e\u6587\u4ef6&#xff0c;\u90a3\u5c31\u662f \/etc\/sysconfig\/nfs \u5566&#xff01; \u4f60\u5728\u8fd9\u4e2a\u6863\u6848\u91cc\u9762\u5c31\u80fd\u591f\u6307\u5b9a\u7279\u5b9a\u7684\u57e0\u53e3&#xff0c;\u8fd9\u6837\u6bcf\u6b21\u542f\u52a8 nfs \u65f6&#xff0c;\u76f8\u5173\u670d\u52a1\u542f\u52a8\u7684\u57e0\u53e3\u5c31\u4f1a\u56fa\u5b9a&#xff0c;\u5982\u6b64\u4e00\u6765&#xff0c; \u6211\u4eec\u5c31\u80fd\u591f\u8bbe\u5b9a\u6b63\u786e\u7684\u9632\u706b\u5899\u5570&#xff01;\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u5f88\u591a&#xff0c;\u7edd\u5927\u90e8\u5206\u7684\u6570\u636e\u4f60\u90fd\u4e0d\u8981\u53bb\u66f4\u6539&#xff0c;\u53ea\u8981\u6539\u8ddf PORT \u8fd9\u4e2a\u5173\u952e\u8bcd\u6709\u5173\u7684\u6570\u636e\u5373\u53ef\u3002 \u90a3\u4e48\u9700\u8981\u66f4\u6539\u7684 rpc \u670d\u52a1\u6709\u54ea\u4e9b\u5462&#xff1f;\u4e3b\u8981\u6709 mountd, rquotad, nlockmgr \u8fd9\u4e09\u4e2a&#xff0c;\u6240\u4ee5\u4f60\u5e94\u8be5\u8981\u8fd9\u6837\u6539&#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\/nfs<\/span><br \/>\nRQUOTAD_PORT&#061;1001   <span style=\"color:#777777\">&lt;&#061;&#061;\u7ea6\u5728 13 \u884c\u5de6\u53f3<\/span><br \/>\nLOCKD_TCPPORT&#061;30001 <span style=\"color:#777777\">&lt;&#061;&#061;\u7ea6\u5728 21 \u884c\u5de6\u53f3<\/span><br \/>\nLOCKD_UDPPORT&#061;30001 <span style=\"color:#777777\">&lt;&#061;&#061;\u7ea6\u5728 23 \u884c\u5de6\u53f3<\/span><br \/>\nMOUNTD_PORT&#061;1002    <span style=\"color:#777777\">&lt;&#061;&#061;\u7ea6\u5728 41 \u884c\u5de6\u53f3<\/span><br \/>\n<span style=\"color:#ff6666\"># \u8bb0\u5f97\u8bbe\u5b9a\u503c\u6700\u5de6\u8fb9\u7684\u6279\u6ce8\u670d\u52a1\u8981\u62ff\u6389\u4e4b\u5916&#xff0c;\u57e0\u53e3\u7684\u503c\u4f60\u4e5f\u53ef\u4ee5\u81ea\u884c\u51b3\u5b9a\u3002<\/span><\/p>\n<p>[root&#064;www ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/nfs restart<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">rpcinfo -p | grep -E &#039;(rquota|mount|nlock)&#039;<\/span><br \/>\n    100011    2   udp   1001  rquotad<br \/>\n    100011    2   tcp   1001  rquotad<br \/>\n    100021    4   udp  30001  nlockmgr<br \/>\n    100021    4   tcp  30001  nlockmgr<br \/>\n    100005    3   udp   1002  mountd<br \/>\n    100005    3   tcp   1002  mountd<br \/>\n<span style=\"color:#ff6666\"># \u4e0a\u8ff0\u7684\u8f93\u51fa\u6570\u636e\u5df2\u7ecf\u88ab\u9e1f\u54e5\u6c47\u6574\u8fc7\u4e86&#xff0c;\u6ca1\u7528\u5230\u7684\u57e0\u53e3\u5148\u632a\u6389\u4e86\u5566&#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\">\u5f88\u53ef\u6015\u5427&#xff01;\u5982\u679c\u60f3\u8981\u5f00\u653e NFS \u7ed9\u522b\u7684\u7f51\u57df\u7684\u670b\u53cb\u4f7f\u7528&#xff0c;\u53c8\u4e0d\u60f3\u8981\u8ba9\u5bf9\u65b9\u62e5\u6709\u5176\u4ed6\u670d\u52a1\u7684\u767b\u5165\u529f\u80fd&#xff0c; \u90a3\u4f60\u7684\u9632\u706b\u5899\u5c31\u5f97\u8981\u5f00\u653e\u4e0a\u8ff0\u7684\u5341\u4e2a\u57e0\u53e3\u5566&#xff01;\u6709\u591f\u9ebb\u70e6\u7684&#xff5e;\u5047\u8bbe\u4f60\u60f3\u8981\u5f00\u653e 120.114.140.0\/24 \u8fd9\u4e2a\u7f51\u57df\u7684\u4eba\u80fd\u591f\u4f7f\u7528\u4f60\u8fd9\u90e8\u670d\u52a1\u5668\u7684 NFS \u7684\u8d44\u6e90&#xff0c;\u4e14\u5047\u8bbe\u4f60\u5df2\u7ecf\u4f7f\u7528\u7b2c\u4e5d\u7ae0\u63d0\u4f9b\u7684\u9632\u706b\u5899\u811a\u672c&#xff0c; \u90a3\u4e48\u4f60\u8fd8\u5f97\u8981\u8fd9\u6837\u505a\u624d\u80fd\u591f\u9488\u5bf9\u8be5\u7f51\u57df\u653e\u884c\u5594&#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 120.114.140.0\/24 -m multiport \\\\<br \/>\n         &#8211;dport 111,2049,1001,1002,30001 -j ACCEPT<br \/>\niptables -A INPUT -i $EXTIF -p udp -s 120.114.140.0\/24 -m multiport \\\\<br \/>\n         &#8211;dport 111,2049,1001,1002,30001 -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\"># \u603b\u662f\u8981\u91cd\u65b0\u6267\u884c\u8fd9\u6837\u9632\u706b\u5899\u89c4\u5219\u624d\u4f1a\u987a\u5229\u7684\u751f\u6548\u554a&#xff01;\u522b\u5fd8\u8bb0&#xff01;\u522b\u5fd8\u8bb0&#xff01;<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f7f\u7528 \/etc\/exports \u8bbe\u5b9a\u66f4\u5b89\u5168\u7684\u6743\u9650&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u5c31\u7275\u6d89\u5230\u4f60\u7684\u903b\u8f91\u601d\u8003\u4e86&#xff01;\u600e\u4e48\u8bbe\u5b9a\u90fd\u6ca1\u6709\u5173\u7cfb&#xff0c;\u4f46\u662f\u5728\u300e\u4fbf\u5229\u300f\u4e0e\u300e\u5b89\u5168\u300f\u4e4b\u95f4&#xff0c;\u8981\u627e\u5230\u4f60\u7684\u5e73\u8861\u70b9\u5436&#xff01;\u5584\u7528\u00a0<span style=\"color:#000088\">root_squash \u53ca all_squash \u7b49\u529f\u80fd&#xff0c;\u518d\u5229\u7528 anonuid\u00a0<\/span>\u7b49\u7b49\u7684\u8bbe\u5b9a\u6765\u89c4\u8303\u767b\u5165\u4f60\u4e3b\u673a\u7684\u7528\u6237\u8eab\u4efd&#xff01;\u5e94\u8be5\u8fd8\u662f\u6709\u529e\u6cd5\u63d0\u4f9b\u4e00\u4e2a\u8f83\u4e3a\u5b89\u5168\u7684 NFS \u670d\u52a1\u5668\u7684&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53e6\u5916&#xff0c;\u5f53\u7136\u5566&#xff0c;\u4f60\u7684 NFS \u670d\u52a1\u5668\u7684\u6587\u4ef6\u7cfb\u7edf\u4e4b\u6743\u9650\u8bbe\u5b9a\u4e5f\u9700\u8981\u5f88\u7559\u610f&#xff01; \u4e0d\u8981\u968f\u4fbf\u8bbe\u5b9a\u6210\u4e3a -rwxrwxrwx &#xff0c;\u8fd9\u6837\u4f1a\u9020\u6210\u4f60\u7684\u7cfb\u7edf\u300e\u5f88\u5927\u7684\u56f0\u6270\u300f\u7684\u554a&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u66f4\u5b89\u5168\u7684 partition \u89c4\u5212&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u4f60\u7684\u5de5\u4f5c\u73af\u5883\u4e2d&#xff0c;\u5177\u6709\u591a\u90e8\u7684 Linux \u4e3b\u673a&#xff0c;\u5e76\u4e14\u9884\u8ba1\u5f7c\u6b64\u5206\u4eab\u51fa\u76ee\u5f55\u65f6&#xff0c;\u90a3\u4e48\u5728\u5b89\u88c5 Linux \u7684\u65f6\u5019&#xff0c;\u6700\u597d\u5c31\u53ef\u4ee5\u89c4\u5212\u51fa\u4e00\u5757 partition \u4f5c\u4e3a\u9884\u7559\u4e4b\u7528\u3002\u56e0\u4e3a\u300e\u00a0<span style=\"color:#000088\">NFS \u53ef\u4ee5\u9488\u5bf9\u76ee\u5f55\u6765\u5206\u4eab<\/span>\u300f&#xff0c;\u56e0\u6b64&#xff0c;\u4f60\u53ef\u4ee5\u5c06\u9884\u7559\u7684 partition \u6302\u8f7d\u5728\u4efb\u4f55\u4e00\u4e2a\u6302\u8f7d\u70b9&#xff0c;\u518d\u5c06\u8be5\u6302\u8f7d\u70b9 (\u5c31\u662f\u76ee\u5f55\u5566&#xff01;)\u7531 \/etc\/exports \u7684\u8bbe\u5b9a\u4e2d\u5206\u4eab\u51fa\u53bb&#xff0c;\u90a3\u4e48\u6574\u4e2a\u5de5\u4f5c\u73af\u5883\u4e2d\u7684\u5176\u4ed6 Linux \u4e3b\u673a\u5c31\u53ef\u4ee5\u4f7f\u7528\u8be5 NFS \u670d\u52a1\u5668\u7684\u90a3\u5757\u9884\u7559\u7684 partition \u4e86&#xff01;\u6240\u4ee5&#xff0c;\u5728\u4e3b\u673a\u7684\u89c4\u5212\u4e0a\u9762&#xff0c;\u4e3b\u8981\u9700\u8981\u7559\u610f\u7684\u53ea\u6709 partition \u800c\u5df2\u3002\u6b64\u5916&#xff0c;\u7531\u4e8e\u5206\u4eab\u7684 partition \u53ef\u80fd\u8f83\u5bb9\u6613\u88ab\u5165\u4fb5&#xff0c;\u6700\u597d\u53ef\u4ee5\u9488\u5bf9\u8be5 partition \u8bbe\u5b9a\u6bd4\u8f83\u4e25\u683c\u7684\u53c2\u6570\u5728 \/etc\/fstab \u5f53\u4e2d\u5594&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6b64\u5916&#xff0c;\u5982\u679c\u4f60\u7684\u5206\u5272\u505a\u7684\u4e0d\u591f\u597d&#xff0c;\u4e3e\u4f8b\u6765\u8bf4&#xff0c;\u5f88\u591a\u4eba\u90fd\u559c\u6b22\u4f7f\u7528\u61d2\u4eba\u5206\u5272\u6cd5&#xff0c;\u4ea6\u5373\u6574\u4e2a\u7cfb\u7edf\u4e2d\u53ea\u6709\u4e00\u4e2a\u6839\u76ee\u5f55\u7684 partition \u800c\u5df2\u3002\u8fd9\u6837\u505a\u4f1a\u6709\u4ec0\u4e48\u95ee\u9898\u5462&#xff1f;\u5047\u8bbe\u4f60\u5206\u4eab\u7684\u662f \/home \u8fd9\u4e2a\u7ed9\u4e00\u822c\u7528\u6237\u7684\u76ee\u5f55\u597d\u4e86&#xff0c;\u6709\u4e9b\u7528\u6237\u89c9\u5f97\u8fd9\u4e2a NFS \u7684\u78c1\u76d8\u592a\u597d\u7528\u4e86&#xff0c; \u7ed3\u679c\u4f7f\u7528\u8005\u5c31\u5c06\u4ed6\u7684\u4e00\u5927\u5806\u6682\u5b58\u6570\u636e\u901a\u901a\u585e\u8fdb\u8fd9\u4e2a NFS \u78c1\u76d8\u4e2d\u3002\u60f3\u4e00\u60f3&#xff0c;\u5982\u679c\u6574\u4e2a\u6839\u76ee\u5f55\u5c31\u56e0\u4e3a\u8fd9\u4e2a \/home \u88ab\u585e\u7206\u4e86&#xff0c; \u90a3\u4e48\u4f60\u7684\u7cfb\u7edf\u5c06\u4f1a\u9020\u6210\u65e0\u6cd5\u8bfb\u5199\u7684\u56f0\u6270\u3002\u56e0\u6b64&#xff0c;\u4e00\u4e2a\u826f\u597d\u7684\u5206\u5272\u89c4\u5212&#xff0c;\u6216\u8005\u662f\u5229\u7528\u78c1\u76d8\u914d\u989d\u6765\u9650\u5236\u8fd8\u662f\u5f88\u91cd\u8981\u7684\u5de5\u4f5c\u3002<\/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\">NFS \u670d\u52a1\u5668\u5173\u673a\u524d\u7684\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u7531\u4e8e NFS \u4f7f\u7528\u7684\u8fd9\u4e2a RPC \u670d\u52a1&#xff0c;\u5f53\u5ba2\u6237\u7aef\u8fde\u4e0a\u670d\u52a1\u5668\u65f6&#xff0c;\u90a3\u4e48\u4f60\u7684\u670d\u52a1\u5668\u60f3\u8981\u5173\u673a&#xff0c; \u90a3\u53ef\u5c31\u4f1a\u6210\u4e3a\u300e\u4e0d\u53ef\u80fd\u7684\u4efb\u52a1\u300f&#xff01;\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u9762\u8fd8\u6709\u5ba2\u6237\u7aef\u5728\u8054\u673a&#xff0c;\u90a3\u4e48\u4f60\u8981\u5173\u673a&#xff0c; \u53ef\u80fd\u5f97\u8981\u7b49\u5230\u6570\u4e2a\u949f\u5934\u624d\u80fd\u591f\u6b63\u5e38\u7684\u5173\u673a\u6210\u529f&#xff01;\u55c4&#xff01;\u771f\u7684\u5047\u7684&#xff01;\u4e0d\u76f8\u4fe1\u5417&#xff1f;\u4e0d\u7136\u4f60\u81ea\u4e2a\u513f\u8bd5\u8bd5\u770b&#xff01;^_^&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6240\u4ee5\u5570&#xff0c;\u5efa\u8bae\u4f60\u7684 NFS Server \u60f3\u8981\u5173\u673a\u4e4b\u524d&#xff0c;\u80fd\u5148\u300e\u5173\u6389 rpcbind \u4e0e nfs \u300f\u8fd9\u4e24\u4e2a\u4e1c\u897f&#xff01; \u5982\u679c\u65e0\u6cd5\u6b63\u786e\u7684\u5c06\u8fd9\u4e24\u4e2a daemons \u5173\u6389&#xff0c;\u90a3\u4e48\u5148\u4ee5 netstat -utlp \u627e\u51fa PID &#xff0c;\u7136\u540e\u4ee5 kill \u5c06\u4ed6\u5173\u6389\u5148&#xff01;\u8fd9\u6837\u624d\u6709\u529e\u6cd5\u6b63\u5e38\u7684\u5173\u673a\u6210\u529f\u5594&#xff01;\u8fd9\u4e2a\u8bf7\u7279\u522b\u7279\u522b\u7684\u6ce8\u610f\u5462&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u7136\u5566&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u5229\u7528\u00a0showmount\u00a0-a localhost \u6765\u67e5\u51fa\u6765\u90a3\u4e2a\u5ba2\u6237\u7aef\u8fd8\u5728\u8054\u673a&#xff1f; \u6216\u8005\u662f\u67e5\u9605 \/var\/lib\/nfs\/rmtab \u6216 xtab \u7b49\u6863\u6848\u6765\u68c0\u67e5\u4ea6\u53ef\u3002\u627e\u5230\u8fd9\u4e9b\u5ba2\u6237\u7aef\u540e&#xff0c; \u53ef\u4ee5\u76f4\u63a5 call \u4ed6\u4eec\u554a&#xff01;\u8ba9\u4ed6\u4eec\u80fd\u591f\u5e2e\u5e2e\u5fd9\u5148&#xff01; ^_^<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e8b\u5b9e\u4e0a&#xff0c;\u5ba2\u6237\u7aef\u4ee5 NFS \u8054\u673a\u5230\u670d\u52a1\u5668\u7aef\u65f6&#xff0c;\u5982\u679c\u4ed6\u4eec\u53ef\u4ee5\u4e0b\u8fbe\u4e00\u4e9b\u6bd4\u8f83\u4e0d\u90a3\u4e48\u300e\u786c\u300f\u7684\u6302\u8f7d\u53c2\u6570\u65f6&#xff0c; \u5c31\u80fd\u591f\u51cf\u5c11\u8fd9\u65b9\u9762\u7684\u95ee\u9898\u5594&#xff01;\u76f8\u5173\u7684\u5b89\u5168\u6027\u53ef\u4ee5\u53c2\u8003\u4e0b\u4e00\u5c0f\u8282\u7684\u00a0\u5ba2\u6237\u7aef\u53ef\u5904\u7406\u7684\u6302\u8f7d\u53c2\u6570\u4e0e\u5f00\u673a\u6302\u8f7d\u3002<\/span><\/span><\/p>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5927\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212626-6804150237966.jpg\" width=\"534\" \/><\/p>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.3 NFS \u5ba2\u6237\u7aef\u7684\u8bbe\u5b9a<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u65e2\u7136 NFS \u670d\u52a1\u5668\u6700\u4e3b\u8981\u7684\u5de5\u4f5c\u5c31\u662f\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u7ed9\u7f51\u7edc\u4e0a\u5176\u4ed6\u7684\u5ba2\u6237\u7aef&#xff0c;\u6240\u4ee5\u5ba2\u6237\u7aef\u5f53\u7136\u5f97\u8981\u6302\u8f7d\u8fd9\u4e2a\u73a9\u610f\u513f\u5570&#xff01; \u6b64\u5916&#xff0c;\u670d\u52a1\u5668\u7aef\u53ef\u4ee5\u52a0\u8bbe\u9632\u706b\u5899\u6765\u4fdd\u62a4\u81ea\u5df1\u7684\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u90a3\u4e48\u5ba2\u6237\u7aef\u6302\u8f7d\u8be5\u6587\u4ef6\u7cfb\u7edf\u540e&#xff0c;\u96be\u9053\u4e0d\u9700\u8981\u4fdd\u62a4\u81ea\u5df1&#xff1f; \u5475\u5475&#xff01;\u6240\u4ee5\u5e95\u4e0b\u6211\u4eec\u8981\u6765\u8c08\u4e00\u8c08\u51e0\u4e2a NFS \u5ba2\u6237\u7aef\u7684\u8bfe\u9898\u3002<\/span><\/span> \u00a0<\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212626-6804150296a2a.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.3.1 \u624b\u52a8\u6302\u8f7d NFS \u670d\u52a1\u5668\u5206\u4eab\u7684\u8d44\u6e90<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f60\u8981\u5982\u4f55\u6302\u8f7d NFS \u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u7cfb\u7edf\u5462&#xff1f;\u57fa\u672c\u4e0a&#xff0c;\u53ef\u4ee5\u8fd9\u6837\u505a&#xff1a;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u786e\u8ba4\u672c\u5730\u7aef\u5df2\u7ecf\u542f\u52a8\u4e86 rpcbind \u670d\u52a1&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u626b\u7784 NFS \u670d\u52a1\u5668\u5206\u4eab\u7684\u76ee\u5f55\u6709\u54ea\u4e9b&#xff0c;\u5e76\u4e86\u89e3\u6211\u4eec\u662f\u5426\u53ef\u4ee5\u4f7f\u7528 (showmount)&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u672c\u5730\u7aef\u5efa\u7acb\u9884\u8ba1\u8981\u6302\u8f7d\u7684\u6302\u8f7d\u70b9\u76ee\u5f55 (mkdir)&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5229\u7528 mount \u5c06\u8fdc\u7a0b\u4e3b\u673a\u76f4\u63a5\u6302\u8f7d\u5230\u76f8\u5173\u76ee\u5f55\u3002<\/span><\/span><\/li>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u597d&#xff0c;\u73b0\u5728\u5047\u8bbe\u5ba2\u6237\u7aef\u5728 192.168.100.10 \u8fd9\u90e8\u673a\u5668\u4e0a&#xff0c;\u800c\u670d\u52a1\u5668\u662f 192.168.100.254 &#xff0c; \u90a3\u4e48\u8d76\u7d27\u6765\u68c0\u67e5\u4e00\u4e0b\u6211\u4eec\u662f\u5426\u5df2\u7ecf\u6709 rpcbind \u7684\u542f\u52a8&#xff0c;\u53e6\u5916\u8fdc\u7a0b\u4e3b\u673a\u6709\u4ec0\u4e48\u53ef\u7528\u7684\u76ee\u5f55\u5462&#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. \u542f\u52a8\u5fc5\u5907\u7684\u670d\u52a1&#xff1a;\u82e5\u6ca1\u6709\u542f\u52a8\u624d\u542f\u52a8&#xff0c;\u6709\u542f\u52a8\u5219\u4fdd\u6301\u539f\u6837\u4e0d\u52a8\u3002<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/rpcbind start<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/nfslock start<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4e00\u822c\u6765\u8bf4&#xff0c;\u7cfb\u7edf\u9ed8\u8ba4\u4f1a\u542f\u52a8 rpcbind &#xff0c;\u4e0d\u8fc7\u9e1f\u54e5\u4e4b\u524d\u5173\u95ed\u8fc7&#xff0c;\u6240\u4ee5\u8981\u542f\u52a8\u3002<br \/>\n# \u53e6\u5916&#xff0c;\u5982\u679c\u670d\u52a1\u5668\u7aef\u6709\u542f\u52a8 nfslock \u7684\u8bdd&#xff0c;\u5ba2\u6237\u7aef\u4e5f\u8981\u542f\u52a8\u624d\u80fd\u751f\u6548&#xff01;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u67e5\u8be2\u670d\u52a1\u5668\u63d0\u4f9b\u54ea\u4e9b\u8d44\u6e90\u7ed9\u6211\u4eec\u4f7f\u7528\u5462&#xff1f;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">showmount -e 192.168.100.254<\/span><br \/>\nExport list for 192.168.100.254:<br \/>\n\/tmp         *<br \/>\n\/home\/linux  *.centos.vbird<br \/>\n\/home\/test   192.168.100.10<br \/>\n\/home\/public (everyone)   <span style=\"color:#777777\">&lt;&#061;&#061;\u8fd9\u662f\u7b49\u4e00\u4e0b\u6211\u4eec\u8981\u6302\u8f7d\u7684\u76ee\u5f55<\/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\u6211\u60f3\u8981\u5c06\u8fdc\u7a0b\u4e3b\u673a\u7684 \/home\/public \u6302\u8f7d\u5230\u672c\u5730\u7aef\u4e3b\u673a\u7684 \/home\/nfs\/public &#xff0c; \u6240\u4ee5\u6211\u5c31\u5f97\u8981\u5728\u672c\u5730\u7aef\u4e3b\u673a\u5148\u5efa\u7acb\u8d77\u8fd9\u4e2a\u6302\u8f7d\u70b9\u76ee\u5f55\u624d\u884c\u554a&#xff01;\u7136\u540e\u5c31\u53ef\u4ee5\u7528 mount \u8fd9\u4e2a\u6307\u4ee4\u76f4\u63a5\u6302\u8f7d NFS \u7684\u6587\u4ef6\u7cfb\u7edf\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. \u5efa\u7acb\u6302\u8f7d\u70b9&#xff0c;\u5e76\u4e14\u5b9e\u9645\u6302\u8f7d\u770b\u770b\u5570&#xff01;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mkdir -p \/home\/nfs\/public<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/home\/public \\\\<\/span><br \/>\n&gt; <span style=\"color:#FFFF00\">\/home\/nfs\/public<\/span><br \/>\n<span style=\"color:#ff6666\"># \u6ce8\u610f\u4e00\u4e0b\u6302\u8f7d\u7684\u8bed\u6cd5&#xff01;\u300e -t nfs \u300f\u6307\u5b9a\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff0c;<br \/>\n# IP:\/dir \u5219\u662f\u6307\u5b9a\u67d0\u4e00\u90e8\u4e3b\u673a\u7684\u67d0\u4e2a\u63d0\u4f9b\u7684\u76ee\u5f55&#xff01;\u53e6\u5916&#xff0c;\u5982\u679c\u51fa\u73b0\u5982\u4e0b\u9519\u8bef&#xff1a;<\/span><br \/>\nmount: 192.168.100.254:\/home\/public failed, reason given by server: No such file<br \/>\nor directory<br \/>\n<span style=\"color:#ff6666\"># \u8fd9\u4ee3\u8868\u4f60\u5728 Server \u4e0a\u9762\u5e76\u6ca1\u6709\u5efa\u7acb \/home\/public \u5566&#xff01;\u81ea\u5df1\u5728\u670d\u52a1\u5668\u7aef\u5efa\u7acb\u4ed6\u5427&#xff01;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 4. \u603b\u662f\u5f97\u8981\u770b\u770b\u6302\u8f7d\u4e4b\u540e\u7684\u60c5\u51b5\u5982\u4f55&#xff0c;\u53ef\u4ee5\u4f7f\u7528 df \u6216 mount \u5566&#xff01;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">df<\/span><br \/>\n\u6587\u4ef6\u7cfb\u7edf               1K-\u533a\u6bb5      \u5df2\u7528     \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9<br \/>\n<span style=\"color:#ff6666\">&#8230;.(\u4e2d\u95f4\u7701\u7565)&#8230;.<\/span><br \/>\n<span style=\"color:#FFFF00\">192.168.100.254:\/home\/public<\/span><br \/>\n                       7104640    143104   6607104   3% <span style=\"color:#FFFF00\">\/home\/nfs\/public<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5148\u6ce8\u610f\u4e00\u4e0b\u6302\u8f7d NFS \u6863\u6848\u7684\u683c\u5f0f\u8303\u4f8b\u5594&#xff01;\u5475\u5475&#xff01;\u8fd9\u6837\u5c31\u53ef\u4ee5\u5c06\u6570\u636e\u6302\u8f7d\u8fdb\u6765\u5566&#xff01;\u8bf7\u6ce8\u610f\u5594&#xff01; \u4ee5\u540e&#xff0c;<span style=\"color:#000088\">\u53ea\u8981\u4f60\u8fdb\u5165\u4f60\u7684\u76ee\u5f55 \/home\/nfs\/public \u5c31\u7b49\u4e8e\u5230\u4e86 192.168.100.254 \u90a3\u90e8\u8fdc\u7a0b\u4e3b\u673a\u7684 \/home\/public \u90a3\u4e2a\u76ee\u5f55\u4e2d\u5570<\/span>&#xff01;\u5f88\u4e0d\u9519\u5427&#xff01;\u81f3\u4e8e\u4f60\u5728\u8be5\u76ee\u5f55\u4e0b\u6709\u4ec0\u4e48\u6743\u9650&#xff1f; \u90a3\u5c31\u8bf7\u4f60\u56de\u53bb\u524d\u4e00\u5c0f\u8282\u67e5\u4e00\u67e5\u6743\u9650\u7684\u601d\u8003\u5427&#xff01; ^_^ &#xff01;\u90a3\u4e48\u5982\u4f55\u5c06\u6302\u8f7d\u7684 NFS \u76ee\u5f55\u5378\u9664\u5462&#xff1f;\u5c31\u4f7f\u7528 umount \u554a&#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\">umount \/home\/nfs\/public<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212627-6804150301882.jpg\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.3.2 \u5ba2\u6237\u7aef\u53ef\u5904\u7406\u7684\u6302\u8f7d\u53c2\u6570\u4e0e\u5f00\u673a\u6302\u8f7d<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u77a7&#xff01;\u5ba2\u6237\u7aef\u7684\u6302\u8f7d\u5de5\u4f5c\u5f88\u7b80\u5355\u5427&#xff01;\u4e0d\u8fc7\u4e0d\u6653\u5f97\u4f60\u6709\u6ca1\u6709\u60f3\u8fc7&#xff0c;\u5982\u679c\u4f60\u521a\u521a\u6302\u8f7d\u5230\u672c\u673a \/home\/nfs\/public \u7684\u6587\u4ef6\u7cfb\u7edf\u5f53\u4e2d&#xff0c;\u542b\u6709\u4e00\u652f script &#xff0c;\u4e14\u8fd9\u652f script \u7684\u5185\u5bb9\u4e3a\u300e rm -rf \/ \u300f\u4e14\u8be5\u6863\u6848\u6743\u9650\u4e3a 555 &#xff0c; \u592d\u5bff&#xff5e;\u5982\u679c\u4f60\u56e0\u4e3a\u597d\u5947\u7ed9\u4ed6\u6267\u884c\u4e0b\u53bb&#xff0c;\u53ef\u6709\u7684\u4f60\u53d7\u7684\u4e86&#xff5e;\u56e0\u4e3a\u6574\u4e2a\u7cfb\u7edf\u90fd\u4f1a\u88ab\u6740\u5149\u5149&#xff01;\u771f\u53ef\u601c&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6240\u4ee5\u8bf4&#xff0c;\u9664\u4e86 NFS \u670d\u52a1\u5668\u9700\u8981\u4fdd\u62a4\u4e4b\u5916&#xff0c;\u6211\u4eec\u53d6\u7528\u4eba\u5bb6\u7684 NFS \u6587\u4ef6\u7cfb\u7edf\u4e5f\u9700\u8981\u81ea\u6211\u4fdd\u62a4\u624d\u884c\u554a&#xff01; \u90a3\u8981\u5982\u4f55\u81ea\u6211\u4fdd\u62a4\u554a&#xff1f;\u53ef\u4ee5\u900f\u8fc7 mount \u7684\u6307\u4ee4\u53c2\u6570\u5594&#xff01;\u5305\u62ec\u5e95\u4e0b\u8fd9\u4e9b\u4e3b\u8981\u7684\u53c2\u6570\u53ef\u4ee5\u5c1d\u8bd5\u52a0\u5165&#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\">\u53c2\u6570<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53c2\u6570\u4ee3\u8868\u610f\u4e49<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u7cfb\u7edf\u9ed8\u8ba4\u503c<\/span><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">suid nosuid<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6653\u5f97\u5565\u662f SUID \u5427&#xff1f;\u5982\u679c\u6302\u8f7d\u7684 partition \u4e0a\u9762\u6709\u4efb\u4f55 SUID \u7684 binary \u7a0b\u5e8f\u65f6&#xff0c; \u4f60\u53ea\u8981\u4f7f\u7528 nosuid \u5c31\u80fd\u591f\u53d6\u6d88 SUID \u7684\u529f\u80fd\u4e86&#xff01;\u55c4&#xff1f;\u4e0d\u77e5\u9053\u4ec0\u4e48\u662f SUID &#xff1f;\u90a3\u5c31\u4e0d\u8981\u5b66\u4eba\u5bb6\u67b6\u7ad9\u561b&#xff01;&#064;_&#064;&#xff01; \u8d76\u7d27\u56de\u53bb\u57fa\u7840\u5b66\u4e60\u7bc7\u7b2c\u4e09\u7248\u590d\u4e60\u4e00\u4e0b\u7b2c\u5341\u4e03\u7ae0\u3001\u7a0b\u5e8f\u4e0e\u8d44\u6e90\u7ba1\u7406\u5566&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">suid<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rw ro<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4f60\u53ef\u4ee5\u6307\u5b9a\u8be5\u6587\u4ef6\u7cfb\u7edf\u662f\u53ea\u8bfb (ro) \u6216\u53ef\u64e6\u5199\u5594&#xff01;\u670d\u52a1\u5668\u53ef\u4ee5\u63d0\u4f9b\u7ed9\u4f60\u53ef\u64e6\u5199&#xff0c; \u4f46\u662f\u5ba2\u6237\u7aef\u53ef\u4ee5\u4ec5\u5141\u8bb8\u53ea\u8bfb\u7684\u53c2\u6570\u8bbe\u5b9a\u503c&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rw<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">dev nodev<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u662f\u5426\u53ef\u4ee5\u4fdd\u7559\u88c5\u7f6e\u6863\u6848\u7684\u7279\u6b8a\u529f\u80fd&#xff1f;\u4e00\u822c\u6765\u8bf4\u53ea\u6709 \/dev \u8fd9\u4e2a\u76ee\u5f55\u624d\u4f1a\u6709\u7279\u6b8a\u7684\u88c5\u7f6e&#xff0c;\u56e0\u6b64\u4f60\u53ef\u4ee5\u9009\u62e9 nodev \u5594&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">dev<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">exec noexec<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u662f\u5426\u5177\u6709\u6267\u884c binary file \u7684\u6743\u9650&#xff1f; \u5982\u679c\u4f60\u60f3\u8981\u6302\u8f7d\u7684\u4ec5\u662f\u6570\u636e\u533a (\u4f8b\u5982 \/home)&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u9009\u62e9 noexec \u554a&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">exec<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">user nouser<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u662f\u5426\u5141\u8bb8\u4f7f\u7528\u8005\u8fdb\u884c\u6863\u6848\u7684\u6302\u8f7d\u4e0e\u5378\u9664\u529f\u80fd&#xff1f; \u5982\u679c\u8981\u4fdd\u62a4\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u6700\u597d\u4e0d\u8981\u63d0\u4f9b\u4f7f\u7528\u8005\u8fdb\u884c\u6302\u8f7d\u4e0e\u5378\u9664\u5427&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">nouser<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">auto noauto<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a auto \u6307\u7684\u662f\u300emount -a\u300f\u65f6&#xff0c;\u4f1a\u4e0d\u4f1a\u88ab\u6302\u8f7d\u7684\u9879\u76ee\u3002 \u5982\u679c\u4f60\u4e0d\u9700\u8981\u8fd9\u4e2a partition \u968f\u65f6\u88ab\u6302\u8f7d&#xff0c;\u53ef\u4ee5\u8bbe\u5b9a\u4e3a noauto\u3002<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">auto<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e00\u822c\u6765\u8bf4&#xff0c;\u5982\u679c\u4f60\u7684 NFS \u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u53ea\u662f\u7c7b\u4f3c \/home \u5e95\u4e0b\u7684\u4e2a\u4eba\u8d44\u6599&#xff0c; \u5e94\u8be5\u4e0d\u9700\u8981\u53ef\u6267\u884c\u3001SUID \u4e0e\u88c5\u7f6e\u6863\u6848&#xff0c;\u56e0\u6b64\u5f53\u4f60\u5728\u6302\u8f7d\u7684\u65f6\u5019&#xff0c;\u53ef\u4ee5\u8fd9\u6837\u4e0b\u8fbe\u6307\u4ee4\u5594&#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\">umount \/home\/nfs\/public<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs -o nosuid,noexec,nodev,rw \\\\<\/span><br \/>\n&gt; <span style=\"color:#FFFF00\">192.168.100.254:\/home\/public \/home\/nfs\/public<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount | grep addr<\/span><br \/>\n192.168.100.254:\/home\/public on \/home\/nfs\/public type nfs (rw,noexec,nosuid,<br \/>\nnodev,vers&#061;4,addr&#061;192.168.100.254,clientaddr&#061;192.168.100.10)<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u6837\u4e00\u6765\u4f60\u6240\u6302\u8f7d\u7684\u8fd9\u4e2a\u6587\u4ef6\u7cfb\u7edf\u5c31\u53ea\u80fd\u4f5c\u4e3a\u8d44\u6599\u5b58\u53d6\u4e4b\u7528&#xff0c;\u76f8\u5bf9\u6765\u8bf4&#xff0c;\u5bf9\u4e8e\u5ba2\u6237\u7aef\u662f\u6bd4\u8f83\u5b89\u5168\u4e00\u4e9b\u7684\u3002 \u6240\u4ee5\u8bf4&#xff0c;\u8fd9\u4e2a\u00a0<span style=\"color:#000088\">nosuid, noexec, nodev<\/span>\u00a0\u7b49\u7b49\u7684\u53c2\u6570\u53ef\u5f97\u8bb0\u5f97\u554a&#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\">\u5173\u4e8e NFS \u7279\u6b8a\u7684\u6302\u8f7d\u53c2\u6570<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u9664\u4e86\u4e0a\u8ff0\u7684 mount \u53c2\u6570\u4e4b\u5916&#xff0c;\u5176\u5b9e\u9488\u5bf9 NFS \u670d\u52a1\u5668&#xff0c;\u54b1\u4eec\u7684 Linux \u8fd8\u63d0\u4f9b\u4e0d\u5c11\u6709\u7528\u7684\u989d\u5916\u53c2\u6570\u5594&#xff01;\u8fd9\u4e9b\u7279\u6b8a\u53c2\u6570\u8fd8\u975e\u5e38\u6709\u7528\u5462&#xff01; \u4e3a\u4ec0\u4e48\u5462&#xff1f;\u4e3e\u4f8b\u6765\u8bf4&#xff0c;\u7531\u4e8e\u6587\u4ef6\u7cfb\u7edf\u5bf9 Linux \u662f\u975e\u5e38\u91cd\u8981\u7684\u4e1c\u897f&#xff0c;\u56e0\u4e3a\u6211\u4eec\u8fdb\u884c\u4efb\u4f55\u52a8\u4f5c\u65f6&#xff0c;\u53ea\u8981\u6709\u7528\u5230\u6587\u4ef6\u7cfb\u7edf&#xff0c; \u90a3\u4e48\u6574\u4e2a\u76ee\u5f55\u6811\u7cfb\u7edf\u5c31\u4f1a\u4e3b\u52a8\u7684\u53bb\u67e5\u8be2\u5168\u90e8\u7684\u6302\u8f7d\u70b9\u3002\u5982\u679c\u4f60\u7684 NFS \u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u8054\u673a\u56e0\u4e3a\u7f51\u7edc\u95ee\u9898&#xff0c; \u6216\u8005\u662f\u670d\u52a1\u5668\u7aef\u5148\u5173\u673a\u4e86&#xff0c;\u5374\u6ca1\u6709\u901a\u77e5\u5ba2\u6237\u7aef&#xff0c;\u90a3\u4e48\u5ba2\u6237\u7aef\u53ea\u8981\u52a8\u5230\u6587\u4ef6\u7cfb\u7edf\u7684\u6307\u4ee4 (\u4f8b\u5982 df, ls, cp \u7b49\u7b49) &#xff0c;\u6574\u4e2a\u7cfb\u7edf\u5c31\u4f1a\u6162\u5230\u7206&#xff01;\u56e0\u4e3a\u4f60\u5fc5\u987b\u8981\u7b49\u5230\u6587\u4ef6\u7cfb\u7edf\u641c\u5bfb\u7b49\u5f85\u903e\u65f6\u540e&#xff0c;\u7cfb\u7edf\u624d\u4f1a\u9976\u4e86\u4f60&#xff01;(\u9e1f\u54e5\u7b49\u8fc7 df \u6307\u4ee4 30 \u5206\u949f\u8fc7&#8230;)<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4e3a\u4e86\u907f\u514d\u8fd9\u4e9b\u56f0\u6270&#xff0c;\u6211\u4eec\u8fd8\u6709\u4e00\u4e9b\u989d\u5916\u7684 NFS \u6302\u8f7d\u53c2\u6570\u53ef\u7528&#xff01;\u4f8b\u5982&#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\">\u53c2\u6570<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53c2\u6570\u529f\u80fd<\/span><\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u9884\u8bbe\u53c2\u6570<\/span><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">fg bg<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u6267\u884c\u6302\u8f7d\u65f6&#xff0c;\u8be5\u6302\u8f7d\u7684\u884c\u4e3a\u4f1a\u5728\u524d\u666f (fg) \u8fd8\u662f\u5728\u80cc\u666f (bg) \u6267\u884c&#xff1f; \u82e5\u5728\u524d\u666f\u6267\u884c\u65f6&#xff0c;\u5219 mount \u4f1a\u6301\u7eed\u5c1d\u8bd5\u6302\u8f7d&#xff0c;\u76f4\u5230\u6210\u529f\u6216 time out \u4e3a\u6b62&#xff0c;\u82e5\u4e3a\u80cc\u666f\u6267\u884c&#xff0c; \u5219 mount \u4f1a\u5728\u80cc\u666f\u6301\u7eed\u591a\u6b21\u8fdb\u884c mount &#xff0c;\u800c\u4e0d\u4f1a\u5f71\u54cd\u5230\u524d\u666f\u7684\u7a0b\u5e8f\u64cd\u4f5c\u3002 \u5982\u679c\u4f60\u7684\u7f51\u7edc\u8054\u673a\u6709\u70b9\u4e0d\u7a33\u5b9a&#xff0c;\u6216\u662f\u670d\u52a1\u5668\u5e38\u5e38\u9700\u8981\u5f00\u5173\u673a&#xff0c;\u90a3\u5efa\u8bae\u4f7f\u7528 bg \u6bd4\u8f83\u59a5\u5f53\u3002<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">fg<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">soft hard<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u662f hard \u7684\u60c5\u51b5&#xff0c;\u5219\u5f53\u4e24\u8005\u4e4b\u95f4\u6709\u4efb\u4f55\u4e00\u90e8\u4e3b\u673a\u8131\u673a&#xff0c;\u5219 RPC \u4f1a\u6301\u7eed\u7684\u547c\u53eb&#xff0c;\u76f4\u5230\u5bf9\u65b9\u6062\u590d\u8054\u673a\u4e3a\u6b62\u3002\u5982\u679c\u662f soft \u7684\u8bdd&#xff0c;\u90a3 RPC \u4f1a\u5728 time out \u540e\u300e\u91cd\u590d\u300f\u547c\u53eb&#xff0c;\u800c\u975e\u300e\u6301\u7eed\u300f\u547c\u53eb&#xff0c; \u56e0\u6b64\u7cfb\u7edf\u7684\u5ef6\u8fdf\u4f1a\u6bd4\u8f83\u4e0d\u8fd9\u4e48\u660e\u663e\u3002\u540c\u4e0a&#xff0c;\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u53ef\u80fd\u5f00\u5f00\u5173\u5173&#xff0c;\u5efa\u8bae\u7528 soft \u5594&#xff01;<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">hard<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">intr<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53\u4f60\u4f7f\u7528\u4e0a\u5934\u63d0\u5230\u7684 hard \u65b9\u5f0f\u6302\u8f7d\u65f6&#xff0c;\u82e5\u52a0\u4e0a intr \u8fd9\u4e2a\u53c2\u6570&#xff0c; \u5219\u5f53 RPC \u6301\u7eed\u547c\u53eb\u4e2d&#xff0c;\u8be5\u6b21\u7684\u547c\u53eb\u662f\u53ef\u4ee5\u88ab\u4e2d\u65ad\u7684 (interrupted)\u3002<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6ca1\u6709<\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rsize wsize<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8bfb\u51fa(rsize)\u4e0e\u5199\u5165(wsize)\u7684\u533a\u5757\u5927\u5c0f (block size)\u3002 \u8fd9\u4e2a\u8bbe\u5b9a\u503c\u53ef\u4ee5\u5f71\u54cd\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u4f20\u8f93\u6570\u636e\u7684\u7f13\u51b2\u8bb0\u5fc6\u5bb9\u91cf\u3002\u4e00\u822c\u6765\u8bf4&#xff0c; \u5982\u679c\u5728\u5c40\u57df\u7f51\u7edc\u5185 (LAN) &#xff0c;\u5e76\u4e14\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u90fd\u5177\u6709\u8db3\u591f\u7684\u5185\u5b58&#xff0c;\u90a3\u8fd9\u4e2a\u503c\u53ef\u4ee5\u8bbe\u5b9a\u5927\u4e00\u70b9&#xff0c; \u6bd4\u5982\u8bf4 32768 (bytes) \u7b49&#xff0c;\u63d0\u5347\u7f13\u51b2\u8bb0\u5fc6\u533a\u5757\u5c06\u53ef\u63d0\u5347 NFS \u6587\u4ef6\u7cfb\u7edf\u7684\u4f20\u8f93\u80fd\u529b&#xff01; \u4f46\u8981\u6ce8\u610f\u8bbe\u5b9a\u7684\u503c\u4e5f\u4e0d\u8981\u592a\u5927&#xff0c;\u6700\u597d\u662f\u8fbe\u5230\u7f51\u7edc\u80fd\u591f\u4f20\u8f93\u7684\u6700\u5927\u503c\u4e3a\u9650\u3002<\/span><\/span><\/td>\n<td><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">rsize&#061;1024 wsize&#061;1024<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u00a0 <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u66f4\u591a\u7684\u53c2\u6570\u53ef\u4ee5\u53c2\u8003 man nfs \u7684\u8f93\u51fa\u6570\u636e\u5594&#xff01; \u901a\u5e38\u5982\u679c\u4f60\u7684 NFS \u662f\u7528\u5728\u9ad8\u901f\u8fd0\u4f5c\u7684\u73af\u5883\u5f53\u4e2d\u7684\u8bdd&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u5efa\u8bae\u52a0\u4e0a\u8fd9\u4e9b\u53c2\u6570\u7684\u8bf4&#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\">umount \/home\/nfs\/public<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs -o nosuid,noexec,nodev,rw \\\\<\/span><br \/>\n&gt; <span style=\"color:#FFFF00\">-o bg,soft,rsize&#061;32768,wsize&#061;32768 \\\\<\/span><br \/>\n&gt; <span style=\"color:#FFFF00\">192.168.100.254:\/home\/public \/home\/nfs\/public<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5219\u5f53\u4f60\u7684 192.168.100.254 \u8fd9\u90e8\u670d\u52a1\u5668\u56e0\u4e3a\u67d0\u4e9b\u56e0\u7d20\u800c\u8131\u673a\u65f6&#xff0c;\u4f60\u7684 NFS \u53ef\u4ee5\u7ee7\u7eed\u5728\u80cc\u666f\u5f53\u4e2d\u91cd\u590d\u7684\u547c\u53eb&#xff01; \u76f4\u5230 NFS \u670d\u52a1\u5668\u518d\u5ea6\u4e0a\u7ebf\u4e3a\u6b62\u3002\u8fd9\u5bf9\u4e8e\u7cfb\u7edf\u7684\u6301\u7eed\u64cd\u4f5c\u8fd8\u662f\u6709\u5e2e\u52a9\u7684\u5566&#xff01; \u5f53\u7136\u5566&#xff0c;<span style=\"color:#000088\">\u90a3\u4e2a rsize \u4e0e wsize \u7684\u5927\u5c0f\u5219\u9700\u8981\u4f9d\u636e\u4f60\u7684\u5b9e\u9645\u7f51\u7edc\u73af\u5883\u800c\u5b9a\u5594<\/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\">\u5728\u9e1f\u54e5\u7684\u5b9e\u9645\u6848\u4f8b\u4e2d&#xff0c;\u67d0\u4e9b\u5927\u578b\u7684\u6a21\u5f0f\u8fd0\u7b97\u5e76\u4e0d\u5141\u8bb8 soft \u8fd9\u4e2a\u53c2\u6570\u5594&#xff01;\u4e3e\u4f8b\u6765\u8bf4&#xff0c;\u9e1f\u54e5\u60ef\u7528\u7684 CMAQ \u7a7a\u6c14\u8d28\u91cf\u6a21\u5f0f&#xff0c; \u8fd9\u4e2a\u6a21\u5f0f\u7684\u4e1b\u96c6\u67b6\u6784\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u4e2d&#xff0c;\u5c31\u4e0d\u5141\u8bb8\u4f7f\u7528 soft \u53c2\u6570&#xff01;\u8fd9\u70b9\u9700\u8981\u7279\u522b\u7559\u610f\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=\"2025-04-204f4xbedcpmk.png\" 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\">\u5c06 NFS \u5f00\u673a\u5373\u6302\u8f7d<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u4eec\u77e5\u9053\u5f00\u673a\u5c31\u6302\u8f7d\u7684\u6302\u8f7d\u70b9\u4e0e\u76f8\u5173\u53c2\u6570\u662f\u5199\u5165 \/etc\/fstab \u4e2d\u7684&#xff0c;\u90a3 NFS \u80fd\u4e0d\u80fd\u5199\u5165 \/etc\/fstab \u5f53\u4e2d\u5462&#xff1f;\u975e\u5e38\u53ef\u60dc\u7684\u662f&#xff0c; \u4e0d\u53ef\u4ee5\u5462&#xff01;\u4e3a\u5565\u5462&#xff1f;\u5206\u6790\u4e00\u4e0b\u5f00\u673a\u7684\u6d41\u7a0b&#xff0c;\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u7f51\u7edc\u7684\u542f\u52a8\u662f\u5728\u672c\u673a\u6302\u8f7d\u4e4b\u540e&#xff0c;\u56e0\u6b64\u5f53\u4f60\u5229\u7528 \/etc\/fstab \u5c1d\u8bd5\u6302\u8f7d NFS \u65f6&#xff0c;\u7cfb\u7edf\u7531\u4e8e\u5c1a\u672a\u542f\u52a8\u7f51\u7edc&#xff0c;\u6240\u4ee5\u80af\u5b9a\u662f\u65e0\u6cd5\u6302\u8f7d\u6210\u529f\u7684\u5566&#xff01;\u90a3\u600e\u529e&#xff1f;\u7b80\u5355&#xff01;\u5c31\u5199\u5165 \/etc\/rc.d\/rc.local \u5373\u53ef&#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\">vim \/etc\/rc.d\/rc.local<\/span><br \/>\n<span style=\"color:#FFFF00\">mount -t nfs -o nosuid,noexec,nodev,rw,bg,soft,rsize&#061;32768,wsize&#061;32768 \\\\<br \/>\n192.168.100.254:\/home\/public \/home\/nfs\/public<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"2025-04-20kfsd5unnwtp.png\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.3.3 \u65e0\u6cd5\u6302\u8f7d\u7684\u539f\u56e0\u5206\u6790<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u5ba2\u6237\u7aef\u5c31\u662f\u65e0\u6cd5\u6302\u8f7d\u670d\u52a1\u5668\u7aef\u6240\u5206\u4eab\u7684\u76ee\u5f55\u65f6&#xff0c;\u5230\u5e95\u662f\u53d1\u751f\u4ec0\u4e48\u95ee\u9898&#xff1f;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5206\u6790\u770b\u770b&#xff1a;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5ba2\u6237\u7aef\u7684\u4e3b\u673a\u540d\u6216 IP \u7f51\u6bb5\u4e0d\u88ab\u5141\u8bb8\u4f7f\u7528&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u4ee5\u4e0a\u9762\u7684\u4f8b\u5b50\u6765\u8bf4\u660e&#xff0c;\u6211\u7684 \/home\/test \u53ea\u80fd\u63d0\u4f9b 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u57df&#xff0c;\u6240\u4ee5\u5982\u679c\u6211\u5728 192.168.100.254 \u8fd9\u90e8\u670d\u52a1\u5668\u4e2d&#xff0c;\u4ee5 localhost (127.0.0.1) \u6765\u6302\u8f7d\u65f6&#xff0c;\u5c31\u4f1a\u65e0\u6cd5\u6302\u8f7d\u4e0a&#xff0c;\u8fd9\u4e2a\u6743\u9650\u6982\u5ff5\u6ca1\u95ee\u9898\u5427&#xff01;\u4e0d\u7136\u4f60\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u4e0a\u8bd5\u8bd5\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\">mount -t nfs localhost:\/home\/test \/mnt<\/span><br \/>\nmount.nfs: access denied by server while mounting localhost:\/home\/test<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u770b\u5230 access denied \u4e86\u5427&#xff1f;\u6ca1\u9519\u5566&#xff5e;\u6743\u9650\u4e0d\u7b26\u5566&#xff01;\u5982\u679c\u786e\u5b9a\u4f60\u7684 IP \u6ca1\u6709\u9519\u8bef&#xff0c;\u90a3\u4e48\u8bf7\u901a\u77e5\u670d\u52a1\u5668\u7aef&#xff0c;\u8bf7\u7ba1\u7406\u5458\u5c06\u4f60\u7684 IP \u52a0\u5165 \/etc\/exports \u8fd9\u4e2a\u6863\u6848\u4e2d\u3002<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u670d\u52a1\u5668\u6216\u5ba2\u6237\u7aef\u67d0\u4e9b\u670d\u52a1\u672a\u542f\u52a8&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a\u6700\u5bb9\u6613\u88ab\u5fd8\u8bb0\u4e86&#xff01;\u5c31\u662f\u5fd8\u8bb0\u4e86\u542f\u52a8 rpcbind \u8fd9\u4e2a\u670d\u52a1\u5566&#xff01;\u5982\u679c\u4f60\u5728\u5ba2\u6237\u7aef\u53d1\u73b0 mount \u7684\u8baf\u606f\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\">mount -t nfs 192.168.100.254:\/home\/test \/mnt<\/span><br \/>\nmount: mount to NFS server &#039;192.168.100.254&#039; failed: System Error: Connection refused.<br \/>\n<span style=\"color:#ff6666\"># \u5982\u679c\u4f60\u4f7f\u7528 ping \u5374\u53d1\u73b0\u7f51\u7edc\u4e0e\u670d\u52a1\u5668\u90fd\u662f\u597d\u7684&#xff0c;\u90a3\u4e48\u8fd9\u4e2a\u95ee\u9898\u5c31\u662f rpcbind \u6ca1\u6709\u5f00\u5566&#xff01;<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/home\/test \/home\/nfs<\/span><br \/>\nmount: mount to NFS server &#039;192.168.100.254&#039; failed: RPC Error: Program not registered.<br \/>\n<span style=\"color:#ff6666\"># \u6ce8\u610f\u770b\u6700\u540e\u9762\u7684\u6570\u636e&#xff0c;\u786e\u5b9e\u6709\u8fde\u4e0a RPC &#xff0c;\u4f46\u662f\u670d\u52a1\u5668\u7684 RPC \u544a\u77e5\u6211\u4eec&#xff0c;\u8be5\u7a0b\u5e8f\u65e0\u6ce8\u518c<\/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\u561b\u5c31\u662f rpcbind \u5fd8\u8bb0\u5f00 (\u7b2c\u4e00\u4e2a\u9519\u8bef)&#xff0c;\u8981\u561b\u5c31\u662f\u670d\u52a1\u5668\u7aef\u7684 nfs \u5fd8\u8bb0\u5f00\u3002\u6700\u9ebb\u70e6\u7684\u662f&#xff0c; \u91cd\u65b0\u542f\u52a8\u4e86 rpcbind \u4f46\u662f\u5374\u5fd8\u8bb0\u91cd\u65b0\u542f\u52a8\u5176\u4ed6\u670d\u52a1 (\u4e0a\u8ff0\u7b2c\u4e8c\u4e2a\u9519\u8bef)&#xff01;\u89e3\u51b3\u7684\u65b9\u6cd5\u5c31\u662f\u53bb\u91cd\u65b0\u542f\u52a8 rpcbind \u7ba1\u7406\u7684\u5176\u4ed6\u6240\u6709\u670d\u52a1\u5c31\u662f\u4e86&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u88ab\u9632\u706b\u5899\u6863\u6389\u4e86&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u7531\u4e8e NFS \u51e0\u4e4e\u4e0d\u5bf9\u5916\u5f00\u653e&#xff0c;\u800c\u5185\u90e8\u7f51\u57df\u53c8\u901a\u5e38\u662f\u5168\u90e8\u7684\u8d44\u6e90\u90fd\u653e\u884c&#xff0c;\u56e0\u6b64\u8fc7\u53bb\u73a9 NFS \u7684\u670b\u53cb (\u5305\u62ec\u9e1f\u54e5\u672c\u4eba\u5566&#xff01;) \u90fd\u6ca1\u6709\u6ce8\u610f\u8fc7 NFS \u7684\u9632\u706b\u5899\u95ee\u9898\u3002\u6700\u8fd1\u8fd9\u51e0\u5e74\u9e1f\u54e5\u5728\u7ba1\u7406\u8ba1\u7b97\u673a\u6559\u5ba4\u65f6&#xff0c;\u6709\u638c\u7ba1\u4e00\u90e8\u8ba1\u7b97\u673a\u6559\u5ba4\u4e3b\u63a7\u9632\u706b\u5899&#xff0c; \u4e3a\u4e86\u62c5\u5fc3\u592a\u5389\u5bb3\u7684\u5b66\u751f\u7ed9\u9e1f\u54e5\u4e71\u641e&#xff0c;\u56e0\u6b64\u8be5 Linux \u9632\u706b\u5899\u9884\u8bbe\u662f\u4ec5\u653e\u884c\u90e8\u5206\u8d44\u6e90\u800c\u5df2\u3002\u4f46\u7531\u4e8e\u8ba1\u7b97\u673a\u6559\u5ba4\u7684\u533a\u7f51\u5185\u9700\u8981\u7528\u5230 Linux \u7684 NFS \u8d44\u6e90&#xff0c;\u7ed3\u679c\u5462&#xff1f;\u7adf\u7136\u6ca1\u529e\u6cd5\u653e\u884c\u554a&#xff01;\u539f\u6765\u5c31\u662f iptables \u6ca1\u6709\u653e\u884c NFS \u6240\u4f7f\u7528\u5230\u7684\u57e0\u53e3&#xff5e;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6240\u4ee5&#xff0c;\u5f53\u4f60\u4e00\u76f4\u65e0\u6cd5\u987a\u5229\u7684\u8fde\u63a5 NFS \u670d\u52a1\u5668&#xff0c;\u8bf7\u5148\u5230\u670d\u52a1\u5668\u7aef&#xff0c;\u5c06\u5ba2\u6237\u7aef\u7684 IP \u5b8c\u5168\u653e\u884c&#xff0c;\u82e5\u786e\u5b9a\u8fd9\u6837\u5c31\u8fde\u7684\u4e0a&#xff0c; \u90a3\u4ee3\u8868\u5c31\u662f\u9632\u706b\u5899\u6709\u95ee\u9898\u5566&#xff01;\u600e\u4e48\u89e3\u51b3\u5462&#xff1f;\u4e0a\u4e00\u5c0f\u8282\u4ecb\u7ecd\u8fc7\u4e86&#xff0c;\u53c2\u8003\u5c06 NFS \u670d\u52a1\u5668\u57e0\u53e3\u56fa\u5b9a\u7684\u65b9\u5f0f\u5427&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><\/span><\/span> <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5c0f\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"2025-04-20fj5e4dls4ke.png\" width=\"534\" \/><\/p>\n<p> <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#0000bb\">13.3.4 \u81ea\u52a8\u6302\u8f7d autofs \u7684\u4f7f\u7528<\/span><\/span><\/span> <\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728\u4e00\u822c NFS \u6587\u4ef6\u7cfb\u7edf\u7684\u4f7f\u7528\u60c5\u51b5\u4e2d&#xff0c;\u5982\u679c\u5ba2\u6237\u7aef\u8981\u4f7f\u7528\u670d\u52a1\u5668\u7aef\u6240\u63d0\u4f9b\u7684 NFS \u6587\u4ef6\u7cfb\u7edf\u65f6&#xff0c;\u8981\u561b\u5c31\u662f\u5f97\u5728 \/etc\/rc.d\/rc.local \u5f53\u4e2d\u8bbe\u5b9a\u5f00\u673a\u65f6\u6302\u8f7d&#xff0c;\u8981\u561b\u5c31\u5f97\u8981\u767b\u5165\u7cfb\u7edf\u540e\u624b\u52a8\u5229\u7528 mount \u6765\u6302\u8f7d\u3002 \u6b64\u5916&#xff0c;\u5ba2\u6237\u7aef\u5f97\u8981\u9884\u5148\u624b\u52a8\u7684\u5efa\u7acb\u597d\u6302\u8f7d\u70b9\u76ee\u5f55&#xff0c;\u7136\u540e\u6302\u8f7d\u4e0a\u6765\u3002\u4f46\u662f\u8fd9\u6837\u7684\u4f7f\u7528\u60c5\u51b5\u6050\u6015\u6709\u70b9\u5c0f\u95ee\u9898\u3002<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u6587\u4ef6\u7cfb\u7edf\u4e0e\u7f51\u7edc\u8054\u673a\u7684\u56f0\u6270&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u4eec\u77e5\u9053 NFS \u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u7684\u8054\u673a\u6216\u8bb8\u4e0d\u4f1a\u6c38\u8fdc\u5b58\u5728&#xff0c;\u800c RPC \u8fd9\u4e2a\u670d\u52a1\u53c8\u633a\u8ba8\u538c\u7684&#xff0c;\u5982\u679c\u6302\u8f7d\u4e86 NFS \u670d\u52a1\u5668\u540e&#xff0c;\u4efb\u4f55\u4e00\u65b9\u8131\u673a\u90fd\u53ef\u80fd\u9020\u6210\u53e6\u5916\u4e00\u65b9\u8001\u662f\u5728\u7b49\u5f85\u903e\u65f6&#xff5e;\u800c\u4e14&#xff0c;\u6302\u8f7d\u7684 NFS \u6587\u4ef6\u7cfb\u7edf\u53ef\u80fd\u53c8\u4e0d\u662f\u5e38\u5e38\u88ab\u4f7f\u7528&#xff0c;\u4f46\u82e5\u4e0d\u6302\u8f7d\u7684\u8bdd&#xff0c;\u6709\u65f6\u5019\u7d27\u6025\u8981\u4f7f\u7528\u65f6\u53c8\u5f97\u901a\u77e5\u7cfb\u7edf\u7ba1\u7406\u5458&#xff0c; \u8fd9\u53c8\u5f88\u4e0d\u65b9\u4fbf&#8230;\u554a&#xff01;\u597d\u8ba8\u538c\u7684\u611f\u89c9\u554a&#xff5e;&#064;_&#064;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6240\u4ee5&#xff0c;\u8ba9\u6211\u4eec\u6362\u4e2a\u601d\u8003\u7684\u89d2\u5ea6\u6765\u8ba8\u8bba\u4e00\u4e0b\u4f7f\u7528 NFS \u7684\u60c5\u5883&#xff1a;<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53ef\u4e0d\u53ef\u4ee5\u8ba9\u5ba2\u6237\u7aef\u5728\u6709\u4f7f\u7528\u5230 NFS \u6587\u4ef6\u7cfb\u7edf\u7684\u9700\u6c42\u65f6\u624d\u8ba9\u7cfb\u7edf\u81ea\u52a8\u6302\u8f7d&#xff1f;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f53 NFS \u6587\u4ef6\u7cfb\u7edf\u4f7f\u7528\u5b8c\u6bd5\u540e&#xff0c;\u53ef\u4e0d\u53ef\u4ee5\u8ba9 NFS \u81ea\u52a8\u5378\u9664&#xff0c;\u4ee5\u907f\u514d\u53ef\u80fd\u7684 RPC \u9519\u8bef&#xff1f;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u679c\u80fd\u8fbe\u5230\u4e0a\u8ff0\u7684\u529f\u80fd&#xff0c;\u90a3\u5c31\u592a\u5b8c\u7f8e\u5566&#xff01;\u6709\u6ca1\u6709\u8fd9\u4e1c\u897f\u5462&#xff1f;\u6709\u7684&#xff0c;\u5728\u73b0\u5728\u7684 Linux \u73af\u5883\u4e0b\u8fd9\u662f\u53ef\u4ee5\u8fbe\u6210\u7684\u7406\u60f3&#xff01;\u7528\u7684\u5c31\u662f autofs \u8fd9\u4e2a\u670d\u52a1\u5566&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">autofs \u7684\u8bbe\u5b9a\u6982\u5ff5&#xff1a;<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">autofs \u8fd9\u4e2a\u670d\u52a1\u5728\u5ba2\u6237\u7aef\u8ba1\u7b97\u673a\u4e0a\u9762&#xff0c;\u4f1a\u6301\u7eed\u7684\u4fa6\u6d4b\u67d0\u4e2a\u6307\u5b9a\u7684\u76ee\u5f55&#xff0c; \u5e76\u9884\u5148\u8bbe\u5b9a\u5f53\u4f7f\u7528\u5230\u8be5\u76ee\u5f55\u4e0b\u7684\u67d0\u4e2a\u6b21\u76ee\u5f55\u65f6&#xff0c;\u5c06\u4f1a\u53d6\u5f97\u6765\u81ea\u670d\u52a1\u5668\u7aef\u7684 NFS \u6587\u4ef6\u7cfb\u7edf\u8d44\u6e90&#xff0c;\u5e76\u8fdb\u884c\u81ea\u52a8\u6302\u8f7d\u7684\u52a8\u4f5c\u3002<\/span>\u00a0\u8bb2\u8fd9\u6837\u6216\u8bb8\u4f60\u6709\u70b9\u6a21\u7cca&#xff0c;\u8ba9\u6211\u4eec\u62ff\u5e95\u4e0b\u8fd9\u4e2a\u56fe\u793a\u6765\u770b\u770b&#xff1a;<\/span><\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"autofs \u81ea\u52a8\u6302\u8f7d\u7684\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u793a\u610f\u56fe\" height=\"299\" src=\"2025-04-20vqv5nkc4oyy.png\" width=\"534\" \/><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u56fe 13.3-1\u3001autofs \u81ea\u52a8\u6302\u8f7d\u7684\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u793a\u610f\u56fe<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5982\u4e0a\u56fe\u6240\u793a&#xff0c;\u6211\u4eec\u7684\u00a0<span style=\"color:#000088\">autofs \u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u4e3a \/etc\/auto.master<\/span>&#xff0c;\u8fd9\u4e2a\u6863\u6848\u7684\u5185\u5bb9\u5f88\u7b80\u5355&#xff0c; \u5982\u4e0a\u6240\u793a&#xff0c;\u6211\u53ea\u8981\u5b9a\u4e49\u51fa\u6700\u4e0a\u5c42\u76ee\u5f55 (\/home\/nfsfile) \u5373\u53ef&#xff0c;\u8fd9\u4e2a\u76ee\u5f55\u5c31\u662f autofs \u4f1a\u4e00\u76f4\u6301\u7eed\u4fa6\u6d4b\u7684\u76ee\u5f55\u5566\u3002 \u81f3\u4e8e\u540e\u7eed\u7684\u6863\u6848\u5219\u662f\u8be5\u76ee\u5f55\u5e95\u4e0b\u5404\u6b21\u76ee\u5f55\u7684\u5bf9\u5e94\u3002\u5728 \/etc\/auto.nfs (\u8fd9\u4e2a\u6863\u6848\u7684\u6863\u540d\u53ef\u81ea\u5b9a\u4e49) \u91cc\u9762\u5219\u53ef\u4ee5\u5b9a\u4e49\u51fa\u6bcf\u4e2a\u6b21\u76ee\u5f55\u6240\u6b32\u6302\u8f7d\u7684\u8fdc\u7a0b\u670d\u52a1\u5668\u7684 NFS \u76ee\u5f55\u8d44\u6e90&#xff01;<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u4e3e\u4f8b\u6765\u8bf4&#xff1a;\u300e\u5f53\u6211\u4eec\u5728\u5ba2\u6237\u7aef\u8981\u4f7f\u7528 \/home\/nfsfile\/public \u7684\u6570\u636e\u65f6&#xff0c;\u6b64\u65f6 autofs \u624d\u4f1a\u53bb 192.168.100.254 \u670d\u52a1\u5668\u4e0a\u6302\u8f7d \/home\/public &#xff01;\u300f\u4e14\u300e\u5f53\u9694\u4e86 5 \u5206\u949f\u6ca1\u6709\u4f7f\u7528\u8be5\u76ee\u5f55\u4e0b\u7684\u6570\u636e\u540e&#xff0c;\u5219\u5ba2\u6237\u7aef\u7cfb\u7edf\u5c06\u4f1a\u4e3b\u52a8\u7684\u5378\u9664 \/home\/nfsfile\/public \u300f\u3002<\/span><\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5f88\u4e0d\u9519\u7528\u7684\u4e00\u4e2a\u5de5\u5177\u5427&#xff01;\u56e0\u4e3a\u6709\u7528\u5230\u670d\u52a1\u5668\u7684\u6570\u636e\u65f6\u624d\u81ea\u52a8\u6302\u8f7d&#xff0c;\u6ca1\u6709\u4f7f\u7528\u4e86\u5c31\u4f1a\u81ea\u52a8\u5378\u9664&#xff01; \u800c\u4e0d\u662f\u4f20\u7edf\u7684\u60c5\u51b5\u4e00\u76f4\u662f\u6302\u8f7d\u7684&#xff01;\u65e2\u7136\u8fd9\u4e48\u597d\u7528&#xff0c;\u90a3\u5c31\u8ba9\u6211\u4eec\u5b9e\u9645\u6765\u64cd\u6f14\u4e00\u4e0b&#xff1a;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5efa\u7acb\u4e3b\u914d\u7f6e\u6587\u4ef6 \/etc\/auto.master &#xff0c;\u5e76\u6307\u5b9a\u4fa6\u6d4b\u7684\u7279\u5b9a\u76ee\u5f55<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u4e2a\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u7684\u5185\u5bb9\u5f88\u7b80\u5355&#xff0c;\u53ea\u8981\u6709\u8981\u88ab\u6301\u7eed\u4fa6\u6d4b\u7684\u76ee\u5f55\u53ca\u300e\u6570\u636e\u5bf9\u5e94\u6587\u4ef6\u300f\u5373\u53ef\u3002 \u90a3\u4e2a\u6570\u636e\u5bf9\u5e94\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u662f\u53ef\u4ee5\u81ea\u884c\u8bbe\u5b9a\u7684&#xff0c;\u5728\u9e1f\u54e5\u8fd9\u4e2a\u4f8b\u5b50\u5f53\u4e2d\u6211\u4f7f\u7528 \/etc\/auto.nfs \u6765\u547d\u540d\u3002<\/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\">vim \/etc\/auto.master<\/span><br \/>\n<span style=\"color:#FFFF00\">\/home\/nfsfile  \/etc\/auto.nfs<\/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\u6570\u636e\u4e2d\u6bd4\u8f83\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u90a3\u4e2a \/home\/nfsfile \u76ee\u5f55\u4e0d\u9700\u8981\u5b58\u5728&#xff0c;\u56e0\u4e3a autofs \u4f1a\u4e3b\u52a8\u7684\u5efa\u7acb\u8be5\u76ee\u5f55&#xff01; \u5982\u679c\u4f60\u5efa\u7acb\u4e86&#xff0c;\u53ef\u80fd\u53cd\u800c\u4f1a\u51fa\u95ee\u9898&#xff5e;\u56e0\u6b64&#xff0c;\u5148\u786e\u5b9a\u4e00\u4e0b\u6ca1\u6709\u8be5\u76ee\u5f55\u5427&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5efa\u7acb\u6570\u636e\u5bf9\u5e94\u6587\u4ef6\u5185 (\/etc\/auto.nfs) \u7684\u6302\u8f7d\u4fe1\u606f\u4e0e\u670d\u52a1\u5668\u5bf9\u5e94\u8d44\u6e90<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u521a\u521a\u6211\u4eec\u6240\u6307\u5b9a\u7684 \/etc\/auto.nfs \u662f\u81ea\u884c\u8bbe\u5b9a\u7684&#xff0c;\u6240\u4ee5\u8fd9\u4e2a\u6863\u6848\u662f\u4e0d\u5b58\u5728\u7684\u3002\u90a3\u4e48\u8fd9\u4e2a\u6863\u6848\u7684\u683c\u5f0f\u662f\u5982\u4f55\u5462&#xff1f;\u4f60\u53ef\u4ee5\u8fd9\u6837\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\"><span style=\"color:#FFFF00\">[\u672c\u5730\u7aef\u6b21\u76ee\u5f55]  [-\u6302\u8f7d\u53c2\u6570]  [\u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u76ee\u5f55]<\/span><br \/>\n<span style=\"color:#ff6666\">\u9009\u9879\u4e0e\u53c2\u6570&#xff1a;<br \/>\n[\u672c\u5730\u7aef\u6b21\u76ee\u5f55] &#xff1a;\u6307\u7684\u5c31\u662f\u5728 \/etc\/auto.master \u5185\u6307\u5b9a\u7684\u76ee\u5f55\u4e4b\u6b21\u76ee\u5f55<br \/>\n[-\u6302\u8f7d\u53c2\u6570]    &#xff1a;\u5c31\u662f\u524d\u4e00\u5c0f\u8282\u63d0\u5230\u7684 rw,bg,soft \u7b49\u7b49\u7684\u53c2\u6570\u5566&#xff01;\u53ef\u6709\u53ef\u65e0&#xff1b;<br \/>\n[\u670d\u52a1\u5668\u6240\u63d0\u4f9b\u7684\u76ee\u5f55] &#xff1a;\u4f8b\u5982 192.168.100.254:\/home\/public \u7b49<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">vim \/etc\/auto.nfs<\/span><br \/>\n<span style=\"color:#FFFF00\">public   -rw,bg,soft,rsize&#061;32768,wsize&#061;32768  192.168.100.254:\/home\/public<br \/>\ntesting  -rw,bg,soft,rsize&#061;32768,wsize&#061;32768  192.168.100.254:\/home\/test<br \/>\ntemp     -rw,bg,soft,rsize&#061;32768,wsize&#061;32768  192.168.100.254:\/tmp<\/span><br \/>\n<span style=\"color:#ff6666\"># \u53c2\u6570\u90e8\u5206&#xff0c;\u53ea\u8981\u6700\u524d\u9762\u52a0\u4e2a &#8211; \u7b26\u53f7\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\">\u8fd9\u6837\u5c31\u53ef\u4ee5\u5efa\u7acb\u5bf9\u5e94\u4e86&#xff01;\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u90a3\u4e9b \/home\/nfsfile\/public \u662f\u4e0d\u9700\u8981\u4e8b\u5148\u5efa\u7acb\u7684&#xff01; \u54b1\u4eec\u7684 autofs \u4f1a\u4e8b\u60c5\u51b5\u6765\u5904\u7406\u5594&#xff01;\u597d\u4e86&#xff0c;\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u770b\u770b\u5982\u4f55\u5b9e\u9645\u8fd0\u4f5c\u5427&#xff01;<\/span><\/span> \u00a0<\/p>\n<ul>\n<li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5b9e\u9645\u8fd0\u4f5c\u4e0e\u89c2\u5bdf<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u914d\u7f6e\u6587\u4ef6\u8bbe\u5b9a\u59a5\u5f53\u540e&#xff0c;\u5f53\u7136\u5c31\u662f\u8981\u542f\u52a8 autofs \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;clientlinux ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/autofs stop<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">\/etc\/init.d\/autofs start<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5f88\u5947\u602a&#xff01;\u975e\u5e38\u602a&#xff01;CentOS 6.x \u7684 autofs \u4f7f\u7528 restart \u4f1a\u5931\u6548&#xff01;\u6240\u4ee5\u9e1f\u54e5\u624d\u8fdb\u884c\u4e24\u6b21<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5047\u8bbe\u4f60\u76ee\u524d\u5e76\u6ca1\u6709\u6302\u8f7d\u4efb\u4f55\u6765\u81ea 192.168.100.254 \u8fd9\u90e8 NFS \u670d\u52a1\u5668\u7684\u8d44\u6e90\u76ee\u5f55\u3002\u597d\u4e86&#xff0c; \u90a3\u8ba9\u6211\u4eec\u5b9e\u9645\u6765\u89c2\u5bdf\u770b\u770b\u51e0\u4e2a\u91cd\u8981\u7684\u6570\u636e\u5427&#xff01;\u5148\u770b\u770b \/home\/nfsfile \u4f1a\u4e0d\u4f1a\u4e3b\u52a8\u7684\u88ab\u5efa\u7acb&#xff1f; \u7136\u540e&#xff0c;\u5982\u679c\u6211\u8981\u8fdb\u5165 \/home\/nfsfile\/public \u65f6&#xff0c;\u6587\u4ef6\u7cfb\u7edf\u4f1a\u5982\u4f55\u53d8\u5316\u5462&#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;clientlinux ~]# <span style=\"color:#FFFF00\">ll -d \/home\/nfsfile<\/span><br \/>\ndrwxr-xr-x. 2 root root <span style=\"color:#FFFF00\">0<\/span> 2011-07-28 00:07 \/home\/nfsfile<br \/>\n<span style=\"color:#ff6666\"># \u4ed4\u7ec6\u770b&#xff0c;\u59b3\u4f1a\u53d1\u73b0 \/home\/nfsfile \u5bb9\u91cf\u662f 0 \u5594&#xff01;\u90a3\u662f\u6b63\u5e38\u7684&#xff01;\u56e0\u4e3a\u662f autofs \u5efa\u7acb\u7684<\/span><\/p>\n<p>[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">cd \/home\/nfsfile\/public<\/span><br \/>\n[root&#064;clientlinux public]# <span style=\"color:#FFFF00\">mount | grep nfsfile<\/span><br \/>\n192.168.100.254:\/home\/public on \/home\/nfsfile\/public type nfs (rw,soft,rsize&#061;32768,<br \/>\nwsize&#061;32768,sloppy,vers&#061;4,addr&#061;192.168.100.254,clientaddr&#061;192.168.100.10)<br \/>\n<span style=\"color:#ff6666\"># \u4e0a\u9762\u7684\u8f93\u51fa\u662f\u540c\u4e00\u884c&#xff01;\u77a7&#xff01;\u7a81\u7136\u51fa\u73b0\u8fd9\u4e2a\u73a9\u610f\u513f&#xff01;\u56e0\u4e3a\u662f\u81ea\u52a8\u6302\u8f7d\u7684\u561b&#xff01;<\/span><\/p>\n<p>[root&#064;clientlinux public]# <span style=\"color:#FFFF00\">df  \/home\/nfsfile\/public<\/span><br \/>\n\u6587\u4ef6\u7cfb\u7edf               1K-\u533a\u6bb5      \u5df2\u7528     \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9<br \/>\n192.168.100.254:\/home\/public<br \/>\n                       7104640    143104   6607040   3% \/home\/nfsfile\/public<br \/>\n<span style=\"color:#ff6666\"># \u6863\u6848\u7684\u6302\u8f7d\u4e5f\u51fa\u73b0\u6ca1\u9519&#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\">\u5475\u5475&#xff01;\u771f\u662f\u597d\u554a&#xff01;\u5982\u6b64\u4e00\u6765&#xff0c;\u5982\u679c\u771f\u7684\u6709\u9700\u8981\u7528\u5230\u8be5\u76ee\u5f55\u65f6&#xff0c;\u7cfb\u7edf\u624d\u4f1a\u53bb\u76f8\u5bf9\u7684\u670d\u52a1\u5668\u4e0a\u9762\u6302\u8f7d&#xff01; \u82e5\u662f\u4e00\u9635\u5b50\u6ca1\u6709\u4f7f\u7528&#xff0c;\u90a3\u4e48\u8be5\u76ee\u5f55\u5c31\u4f1a\u88ab\u5378\u9664\u5462&#xff01;\u8fd9\u6837\u5c31\u51cf\u5c11\u4e86\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u4f7f\u7528\u65f6\u673a\u5566&#xff01;\u8fd8\u4e0d\u9519\u7528\u5427&#xff01; ^_^<\/span><\/span><\/p>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5927\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"2025-04-202nhg4mxec3e.png\" width=\"534\" \/><\/p>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.4 \u6848\u4f8b\u6f14\u7ec3<\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8ba9\u6211\u4eec\u6765\u505a\u4e2a\u5b9e\u9645\u6f14\u7ec3&#xff0c;\u5728\u7ec3\u4e60\u4e4b\u524d&#xff0c;\u8bf7\u5c06\u670d\u52a1\u5668\u7684 NFS \u8bbe\u5b9a\u6570\u636e\u90fd\u6e05\u9664&#xff0c;\u4f46\u662f\u4fdd\u7559 rpcbind \u4e0d\u53ef\u5173\u95ed\u3002\u81f3\u4e8e\u5ba2\u6237\u7aef\u7684\u73af\u5883\u4e0b&#xff0c; \u5148\u5173\u95ed autofs \u4ee5\u53ca\u53d6\u6d88\u4e4b\u524d\u5728 \/etc\/rc.d\/rc.local \u91cc\u9762\u5199\u5165\u7684\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\u9879\u76ee\u3002\u540c\u65f6\u5220\u9664 \/home\/nfs \u76ee\u5f55\u5466&#xff01; \u63a5\u4e0b\u6765\u8bf7\u770b\u770b\u6211\u4eec\u8981\u5904\u7406\u7684\u73af\u5883\u4e3a\u4f55&#xff1a;<\/span><\/span><\/p>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u6a21\u62df\u7684\u73af\u5883\u72b6\u6001\u4e2d&#xff0c;\u670d\u52a1\u5668\u7aef\u7684\u60f3\u6cd5\u5982\u4e0b&#xff1a;<\/span><\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5047\u8bbe\u670d\u52a1\u5668\u7684 IP \u4e3a 192.168.100.254 \u8fd9\u4e00\u90e8&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/tmp \u5206\u4eab\u4e3a\u53ef\u64e6\u5199&#xff0c;\u5e76\u4e14\u4e0d\u9650\u5236\u4f7f\u7528\u8005\u8eab\u4efd\u7684\u65b9\u5f0f&#xff0c;\u5206\u4eab\u7ed9\u6240\u6709 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u57df\u4e2d\u7684\u6240\u6709\u8ba1\u7b97\u673a&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/nfs \u5206\u4eab\u7684\u5c5e\u6027\u4e3a\u53ea\u8bfb&#xff0c;\u53ef\u63d0\u4f9b\u9664\u4e86\u7f51\u57df\u5185\u7684\u5de5\u4f5c\u7ad9\u5916&#xff0c;\u5411 Internet \u4ea6\u63d0\u4f9b\u6570\u636e\u5185\u5bb9&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/upload \u505a\u4e3a 192.168.100.0\/24 \u8fd9\u4e2a\u7f51\u57df\u7684\u6570\u636e\u4e0a\u4f20\u76ee\u5f55&#xff0c;\u5176\u4e2d&#xff0c;\u8fd9\u4e2a \/home\/upload \u7684\u4f7f\u7528\u8005\u53ca\u6240\u5c5e\u7fa4\u7ec4\u4e3a nfs-upload \u8fd9\u4e2a\u540d\u5b57&#xff0c;\u4ed6\u7684 UID \u4e0e GID \u5747\u4e3a 210&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\/home\/andy \u8fd9\u4e2a\u76ee\u5f55\u4ec5\u5206\u4eab\u7ed9 192.168.100.10 \u8fd9\u90e8\u4e3b\u673a&#xff0c;\u4ee5\u63d0\u4f9b\u8be5\u4e3b\u673a\u4e0a\u9762 andy \u8fd9\u4e2a\u4f7f\u7528\u8005\u6765\u4f7f\u7528&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c; andy \u5728 192.168.100.10 \u53ca 192.168.100.254 \u5747\u6709\u8d26\u53f7&#xff0c;\u4e14\u8d26\u53f7\u5747\u4e3a andy &#xff0c;\u6240\u4ee5\u9884\u8ba1\u5f00\u653e \/home\/andy \u7ed9 andy \u4f7f\u7528\u4ed6\u7684\u5bb6\u76ee\u5f55\u5566&#xff01;<\/span><\/span><\/li>\n<hr \/>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#000088\">\u670d\u52a1\u5668\u7aef\u8bbe\u5b9a\u7684\u5b9e\u5730\u6f14\u7ec3&#xff1a;<\/span><\/span><\/span><\/p>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u597d\u4e86&#xff0c;\u90a3\u4e48\u8bf7\u4f60\u5148\u4e0d\u8981\u770b\u5e95\u4e0b\u7684\u7b54\u6848&#xff0c;\u5148\u81ea\u5df1\u52a8\u7b14\u6216\u8005\u76f4\u63a5\u5728\u81ea\u5df1\u7684\u673a\u5668\u4e0a\u9762\u52a8\u624b\u4f5c\u4f5c\u770b&#xff0c;\u7b49\u5230\u5f97\u5230\u4f60\u8981\u7684\u7b54\u6848\u4e4b\u540e&#xff0c; \u518d\u770b\u5e95\u4e0b\u7684\u8bf4\u660e\u5427&#xff01;<\/span><\/span><\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u9996\u5148&#xff0c;\u5c31\u662f\u8981\u5efa\u7acb \/etc\/exports \u8fd9\u4e2a\u6863\u6848\u7684\u5185\u5bb9\u5570&#xff0c;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5199\u5427&#xff01;<\/span><\/span><br \/>\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\/exports<\/span><br \/>\n\/tmp         192.168.100.0\/24(rw,no_root_squash)<br \/>\n\/home\/nfs    192.168.100.0\/24(ro)  *(ro,all_squash)<br \/>\n\/home\/upload 192.168.100.0\/24(rw,all_squash,anonuid&#061;210,anongid&#061;210)<br \/>\n\/home\/andy   192.168.100.10(rw)<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u518d\u6765&#xff0c;\u5c31\u662f\u8981\u5efa\u7acb\u6bcf\u4e2a\u5bf9\u5e94\u7684\u76ee\u5f55\u7684\u5b9e\u9645 Linux \u6743\u9650\u4e86&#xff01;\u6211\u4eec\u4e00\u4e2a\u4e00\u4e2a\u6765\u770b&#xff1a;<\/span><\/span><br \/>\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. \/tmp<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">ll -d \/tmp<\/span><br \/>\n<span style=\"color:#FFFF00\">drwxrwxrwt<\/span>. 12 root root 4096 2011-07-27 23:49 \/tmp<\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \/home\/nfs<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">mkdir -p \/home\/nfs<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chmod 755 -R \/home\/nfs<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4fee\u6539\u8f83\u4e3a\u4e25\u683c\u7684\u6863\u6848\u6743\u9650\u5c06\u76ee\u5f55\u4e0e\u6863\u6848\u8bbe\u5b9a\u6210\u53ea\u8bfb&#xff01;\u4e0d\u80fd\u5199\u5165\u7684\u72b6\u6001&#xff0c;\u4f1a\u66f4\u4fdd\u9669\u4e00\u70b9&#xff01;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 3. \/home\/upload<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">groupadd -g 210 nfs-upload<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd -g 210 -u 210 -M nfs-upload<\/span><br \/>\n<span style=\"color:#ff6666\"># \u5148\u5efa\u7acb\u5bf9\u5e94\u7684\u8d26\u53f7\u4e0e\u7ec4\u540d\u53ca UID \u5594&#xff01;<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">mkdir -p \/home\/upload<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">chown -R nfs-upload:nfs-upload \/home\/upload<\/span><br \/>\n<span style=\"color:#ff6666\"># \u4fee\u6539\u62e5\u6709\u8005&#xff01;\u5982\u6b64&#xff0c;\u5219\u7528\u6237\u4e0e\u76ee\u5f55\u7684\u6743\u9650\u90fd\u8bbe\u5b9a\u59a5\u5f53\u5570&#xff01;<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 4. \/home\/andy<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">useradd andy<\/span><br \/>\n[root&#064;www ~]# <span style=\"color:#FFFF00\">ll -d \/home\/andy<\/span><br \/>\ndrwx&#8212;&#8212;. 4 andy andy 4096 2011-07-28 00:15 \/home\/andy<br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u8fd9\u6837\u5b50\u4e00\u6765&#xff0c;\u6743\u9650\u7684\u95ee\u9898\u5927\u6982\u5c31\u53ef\u4ee5\u89e3\u51b3\u5570&#xff01;<\/span><\/span> \u00a0<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u91cd\u65b0\u542f\u52a8 nfs \u670d\u52a1&#xff1a;<\/span><\/span><br \/>\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\">\/etc\/init.d\/nfs restart<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 192.168.100.10 \u8fd9\u90e8\u673a\u5668\u4e0a\u9762\u6f14\u7ec3\u4e00\u4e0b&#xff1a;<\/span><\/span><br \/>\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. \u786e\u8ba4\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u53ef\u7528\u76ee\u5f55&#xff1a;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">showmount -e 192.168.100.254<\/span><br \/>\nExport list for 192.168.100.254:<br \/>\n\/home\/andy   192.168.100.10<br \/>\n\/home\/upload 192.168.100.0\/24<br \/>\n\/home\/nfs    (everyone)<br \/>\n\/tmp         192.168.100.0\/24<\/p>\n<p><span style=\"color:#bbbbbb\"># 2. \u5efa\u7acb\u6302\u8f7d\u70b9&#xff1a;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mkdir -p \/mnt\/{tmp,nfs,upload,andy}<\/span><\/p>\n<p><span style=\"color:#bbbbbb\"># 3. \u5b9e\u9645\u6302\u8f7d&#xff1a;<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/tmp         \/mnt\/tmp<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/home\/nfs    \/mnt\/nfs<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/home\/upload \/mnt\/upload<\/span><br \/>\n[root&#064;clientlinux ~]# <span style=\"color:#FFFF00\">mount -t nfs 192.168.100.254:\/home\/andy   \/mnt\/andy<\/span><br \/>\n<\/span><\/span><\/span> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<p><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6574\u4e2a\u6b65\u9aa4\u5927\u81f4\u4e0a\u5c31\u662f\u8fd9\u6837\u5436&#xff01;\u52a0\u6cb9\u5594&#xff01;<\/span><\/span><\/p>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5927\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"2025-04-204za53k0cosc.png\" width=\"534\" \/><\/p>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.5 \u91cd\u70b9\u56de\u987e<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">Network FileSystem (NFS) \u53ef\u4ee5\u8ba9\u4e3b\u673a\u4e4b\u95f4\u900f\u8fc7\u7f51\u7edc\u5206\u4eab\u5f7c\u6b64\u7684\u6863\u6848\u4e0e\u76ee\u5f55&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u4e3b\u8981\u662f\u900f\u8fc7 RPC \u6765\u8fdb\u884c file share \u7684\u76ee\u7684&#xff0c;\u6240\u4ee5 Server \u4e0e Client \u7684 RPC \u4e00\u5b9a\u8981\u542f\u52a8\u624d\u884c&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u7684\u914d\u7f6e\u6587\u4ef6\u5c31\u662f \/etc\/exports \u8fd9\u4e2a\u6863\u6848&#xff1b;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u7684\u6743\u9650\u53ef\u4ee5\u89c2\u5bdf \/var\/lib\/nfs\/etab&#xff0c;\u81f3\u4e8e\u7684\u91cd\u8981\u767b\u5f55\u6863\u53ef\u4ee5\u53c2\u8003 \/var\/lib\/nfs\/xtab \u8fd9\u4e2a\u6863\u6848&#xff0c;\u8fd8\u5305\u542b\u76f8\u5f53\u591a\u6709\u7528\u7684\u4fe1\u606f\u5728\u5176\u4e2d&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\u8005\u8d26\u53f7\u540d\u79f0\u3001UID \u6700\u597d\u8981\u4e00\u81f4&#xff0c;\u53ef\u4ee5\u907f\u514d\u6743\u9650\u9519\u4e71&#xff1a;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u9884\u8bbe\u5bf9\u5ba2\u6237\u7aef\u7684 root \u8fdb\u884c\u6743\u9650\u538b\u7f29&#xff0c;\u901a\u5e38\u538b\u7f29\u5176\u6210\u4e3a nfsnobody \u6216 nobody\u3002<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u5728\u66f4\u52a8 \/etc\/exports \u8fd9\u4e2a\u6863\u6848\u4e4b\u540e&#xff0c;\u53ef\u4ee5\u900f\u8fc7 exportfs \u8fd9\u4e2a\u6307\u4ee4\u6765\u91cd\u65b0\u6302\u8f7d\u5206\u4eab\u7684\u76ee\u5f55&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u53ef\u4ee5\u4f7f\u7528 rpcinfo \u6765\u89c2\u5bdf RPC program \u4e4b\u95f4\u7684\u5173\u7cfb&#xff01;&#xff01;&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u670d\u52a1\u5668\u5728\u8bbe\u5b9a\u4e4b\u521d&#xff0c;\u5c31\u5fc5\u987b\u8981\u8003\u8651\u5230 client \u7aef\u767b\u5165\u7684\u6743\u9650\u95ee\u9898&#xff0c;\u5f88\u591a\u65f6\u5019\u65e0\u6cd5\u5199\u5165\u6216\u8005\u65e0\u6cd5\u8fdb\u884c\u5206\u4eab&#xff0c;\u4e3b\u8981\u662f Linux \u5b9e\u4f53\u6863\u6848\u7684\u6743\u9650\u8bbe\u5b9a\u95ee\u9898\u6240\u81f4&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u5ba2\u6237\u7aef\u53ef\u4ee5\u900f\u8fc7\u4f7f\u7528 showmount, mount \u4e0e umount \u6765\u4f7f\u7528 NFS \u4e3b\u673a\u63d0\u4f9b\u7684\u5206\u4eab\u7684\u76ee\u5f55&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u4ea6\u53ef\u4ee5\u4f7f\u7528\u6302\u8f7d\u53c2\u6570&#xff0c;\u5982 bg, soft, rsize, wsize, nosuid, noexec, nodev \u7b49\u53c2\u6570&#xff0c; \u6765\u8fbe\u5230\u4fdd\u62a4\u81ea\u5df1\u6587\u4ef6\u7cfb\u7edf\u7684\u76ee\u6807&#xff01;<\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u81ea\u52a8\u6302\u8f7d\u7684 autofs \u670d\u52a1\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u9700\u8981 NFS \u670d\u52a1\u5668\u63d0\u4f9b\u7684\u8d44\u6e90\u65f6\u624d\u6302\u8f7d\u3002<\/span><\/span><\/li>\n<\/ul>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u5927\u6807\u9898\u7684\u56fe\u793a\" height=\"299\" src=\"2025-04-20kb2wskmrn1z.png\" width=\"534\" \/><\/p>\n<p><span style=\"color:#0000bb\"><span style=\"background-color:#ffffff\">13.6 \u672c\u7ae0\u4e60\u9898<\/span><\/span><\/p>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">NFS \u7684\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u4e3a\u4f55&#xff1f;\u800c\u5728\u8be5\u6863\u6848\u5185\u4e3b\u8981\u8bbe\u5b9a\u9879\u76ee\u4e3a\u4f55&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a \/etc\/exports \u800c\u81f3\u4e8e\u5176\u8bbe\u5b9a\u7684\u5185\u5bb9\u9879\u76ee\u5728\u6bcf\u4e00\u884c\u5f53\u4e2d\u5219\u4e3a&#xff1a;<\/span><\/span><\/span> <\/p>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u5206\u4eab\u7684\u76ee\u5f55<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u9488\u5bf9\u6b64\u5206\u4eab\u76ee\u5f55\u5f00\u653e\u7684\u4e3b\u673a\u6216 IP\u6216\u7f51\u57df<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u9488\u5bf9\u8fd9\u90e8\u4e3b\u673a\u6240\u5f00\u653e\u7684\u6743\u9650\u53c2\u6570&#xff01;<\/span><\/span><\/span><\/li>\n<\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 NFS \u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u5f53\u4e2d\u4ec5\u6709\u5c11\u8bb8\u7684\u53c2\u6570\u8bf4\u660e&#xff0c;\u81f3\u4e8e\u9884\u8bbe\u7684\u53c2\u6570\u8bf4\u660e\u5219\u6ca1\u6709\u5728\u8be5\u6863\u6848\u5f53\u4e2d\u51fa\u73b0&#xff0c; \u8bf7\u95ee&#xff0c;\u5982\u679c\u8981\u67e5\u9605\u66f4\u8be6\u7ec6\u7684\u5206\u4eab\u51fa\u6765\u7684\u6863\u6848\u7684\u5c5e\u6027&#xff0c;\u8981\u770b\u90a3\u4e2a\u6863\u6848&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\/var\/lib\/nfs\/etab<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 client \u7aef\u5982\u679c\u8981\u6302\u8f7d NFS \u6240\u63d0\u4f9b\u5206\u4eab\u7684\u6863\u6848&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u90a3\u4e2a\u6307\u4ee4&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u90a3\u81ea\u7136\u5c31\u662f mount \u5566&#xff01;\u8fd8\u6709\u5378\u9664\u662f umount \u5594&#xff01;<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u5728 NFS \u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u5f53\u4e2d&#xff0c;\u53ef\u4ee5\u900f\u8fc7\u90a3\u4e2a\u53c2\u6570\u6765\u63a7\u5236\u4e0d\u8ba9 client \u7aef\u4ee5 root \u7684\u8eab\u4efd\u4f7f\u7528\u4f60\u6240\u5206\u4eab\u51fa\u6765\u7684\u76ee\u5f55\u4e0e\u6863\u6848&#xff1f;<\/span><\/span>\n<p>    <span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53ef\u4ee5\u5728 \/etc\/exports \u5f53\u4e2d\u7684\u53c2\u6570\u9879\u76ee&#xff0c;\u8bbe\u5b9a\u300e root_squash \u300f\u6765\u63a7\u5236\u538b\u7f29 root \u7684\u8eab\u4efd\u5594&#xff01;<\/span><\/span><\/span>\n    <\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\">\u6211\u5728 client \u7aef\u6302\u8f7d\u4e86 NFS Server \u7684\u67d0\u4e2a\u76ee\u5f55\u5728\u6211\u7684 \/home\/data \u5e95\u4e0b&#xff0c;\u5f53\u6211\u6267\u884c\u5176\u4e2d\u67d0\u4e2a\u7a0b\u5e8f\u65f6&#xff0c;\u5374\u53d1\u73b0\u6211\u7684\u7cfb\u7edf\u88ab\u7834\u574f\u4e86&#xff1f;\u4f60\u8ba4\u4e3a\u53ef\u80fd\u7684\u539f\u56e0\u4e3a\u4f55&#xff1f; \u8be5\u5982\u4f55\u514b\u670d\u8fd9\u6837\u7684\u95ee\u9898&#xff0c;\u5c24\u5176\u662f\u5f53\u6211\u7684 Client \u7aef\u4e3b\u673a\u5176\u5b9e\u662f\u591a\u4eba\u5171\u4eab\u7684\u73af\u5883&#xff0c; \u6015\u5176\u4ed6\u7684\u4f7f\u7528\u8005\u4e5f\u540c\u6837\u53d1\u751f\u7c7b\u4f3c\u7684\u95ee\u9898\u5462&#xff1f;&#xff01;<\/span><\/span>\n<ul>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53ef\u80fd\u7531\u4e8e\u4f60\u6302\u8f7d\u8fdb\u6765\u7684 NFS Server \u7684 partition \u5f53\u4e2d\u5177\u6709 SUID \u7684\u6587\u4ef6\u5c5e\u6027&#xff0c;\u800c\u4f60\u4e0d\u5c0f\u5fc3\u4f7f\u7528\u4e86\u8be5\u6267\u884c\u6863&#xff0c;\u56e0\u6b64\u5c31\u53ef\u80fd\u4f1a\u53d1\u751f\u7cfb\u7edf\u88ab\u7834\u574f\u7684\u95ee\u9898\u4e86&#xff01;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53ef\u4ee5\u5c06\u6302\u8f7d\u8fdb\u6765\u7684 NFS \u76ee\u5f55\u7684 SUID \u529f\u80fd\u53d6\u6d88&#xff01;\u4f8b\u5982&#xff1a;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53ef\u80fd\u7531\u4e8e\u4f60\u6302\u8f7d\u8fdb\u6765\u7684 NFS Server \u7684 partition \u5f53\u4e2d\u5177\u6709 SUID \u7684\u6587\u4ef6\u5c5e\u6027&#xff0c;\u800c\u4f60\u4e0d\u5c0f\u5fc3\u4f7f\u7528\u4e86\u8be5\u6267\u884c\u6863&#xff0c;\u56e0\u6b64\u5c31\u53ef\u80fd\u4f1a\u53d1\u751f\u7cfb\u7edf\u88ab\u7834\u574f\u7684\u95ee\u9898\u4e86&#xff01;<\/span><\/span><\/span><\/li>\n<li><span style=\"color:#000000\"><span style=\"background-color:#ffffff\"><span style=\"color:#ffffff\">\u53ef\u4ee5\u5c06\u6302\u8f7d\u8fdb\u6765\u7684 NFS \u76ee\u5f55\u7684 SUID \u529f\u80fd\u53d6\u6d88&#xff01;\u4f8b\u5982&#xff1a; mount -t nfs -o nosuid,ro server:\/directory \/your\/directory<\/span><\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf9\u6b21\u300213.1 NFS \u7684\u7531\u6765\u4e0e\u5176\u529f\u80fdNFS \u8fd9\u4e2a\u85c9\u7531\u7f51\u7edc\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u7684\u670d\u52a1\u5728\u67b6\u8bbe\u7684\u65f6\u5019\u662f\u5f88\u7b80\u5355\u7684\uff0c\u4e0d\u8fc7\uff0c\u5b83\u6700\u5927\u7684\u95ee\u9898\u5728\u4e8e\u300e\u6743\u9650\u300f\u65b9\u9762\u7684\u6982\u5ff5\uff01 \u56e0\u4e3a\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u53ef\u80fd\u5fc5\u987b\u8981\u5177\u5907\u76f8\u540c\u7684\u8d26\u53f7\u624d\u80fd\u591f\u5b58\u53d6\u67d0\u4e9b\u76ee\u5f55\u6216\u6863\u6848\u3002 \u53e6\u5916\uff0cNFS \u7684\u542f\u52a8\u9700\u8981\u900f\u8fc7\u6240\u8c13\u7684\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC)\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u5e76\u4e0d\u662f\u53ea\u8981\u542f\u52a8 NFS \u5c31\u597d\u4e86\uff0c \u8fd8\u9700\u8981\u542f\u52a8 RPC \u8fd9\u4e2a\u670d\u52a1\u624d\u884c\u554a\uff01\u56e0\u6b64\uff0c\u5728\u5f00\u59cb\u8fdb\u884c NFS \u7684\u8bbe\u5b9a\u4e4b\u524d\uff0c\u6211\u4eec\u5f97\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\uff0c\u4ec0\u4e48\u662f NFS \u5462\uff1f\u4e0d\u7136\u8bb2\u4e86\u4e00\u5806\u4e5f\u6ca1\u6709\u7528\uff0c\u5bf9\u5427\uff01 ^_^\uff01 \u5e95\u4e0b\u5c31\u6765\u8c08\u4e00\u8c08\u4ec0\u4e48\u662f NFS_nfs \u6587\u4ef6\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":29043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[995,43,44],"topic":[],"class_list":["post-29063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","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\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \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\/29063.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf9\u6b21\u300213.1 NFS \u7684\u7531\u6765\u4e0e\u5176\u529f\u80fdNFS \u8fd9\u4e2a\u85c9\u7531\u7f51\u7edc\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u7684\u670d\u52a1\u5728\u67b6\u8bbe\u7684\u65f6\u5019\u662f\u5f88\u7b80\u5355\u7684\uff0c\u4e0d\u8fc7\uff0c\u5b83\u6700\u5927\u7684\u95ee\u9898\u5728\u4e8e\u300e\u6743\u9650\u300f\u65b9\u9762\u7684\u6982\u5ff5\uff01 \u56e0\u4e3a\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u53ef\u80fd\u5fc5\u987b\u8981\u5177\u5907\u76f8\u540c\u7684\u8d26\u53f7\u624d\u80fd\u591f\u5b58\u53d6\u67d0\u4e9b\u76ee\u5f55\u6216\u6863\u6848\u3002 \u53e6\u5916\uff0cNFS \u7684\u542f\u52a8\u9700\u8981\u900f\u8fc7\u6240\u8c13\u7684\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC)\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u5e76\u4e0d\u662f\u53ea\u8981\u542f\u52a8 NFS \u5c31\u597d\u4e86\uff0c \u8fd8\u9700\u8981\u542f\u52a8 RPC \u8fd9\u4e2a\u670d\u52a1\u624d\u884c\u554a\uff01\u56e0\u6b64\uff0c\u5728\u5f00\u59cb\u8fdb\u884c NFS \u7684\u8bbe\u5b9a\u4e4b\u524d\uff0c\u6211\u4eec\u5f97\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\uff0c\u4ec0\u4e48\u662f NFS \u5462\uff1f\u4e0d\u7136\u8bb2\u4e86\u4e00\u5806\u4e5f\u6ca1\u6709\u7528\uff0c\u5bf9\u5427\uff01 ^_^\uff01 \u5e95\u4e0b\u5c31\u6765\u8c08\u4e00\u8c08\u4ec0\u4e48\u662f NFS_nfs \u6587\u4ef6\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/29063.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-19T21:26:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212619-680414fb8da10.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=\"21 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29063.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/29063.html\",\"name\":\"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T21:26:28+00:00\",\"dateModified\":\"2025-04-19T21:26:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/29063.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/29063.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29063.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \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\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \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\/29063.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf9\u6b21\u300213.1 NFS \u7684\u7531\u6765\u4e0e\u5176\u529f\u80fdNFS \u8fd9\u4e2a\u85c9\u7531\u7f51\u7edc\u5206\u4eab\u6587\u4ef6\u7cfb\u7edf\u7684\u670d\u52a1\u5728\u67b6\u8bbe\u7684\u65f6\u5019\u662f\u5f88\u7b80\u5355\u7684\uff0c\u4e0d\u8fc7\uff0c\u5b83\u6700\u5927\u7684\u95ee\u9898\u5728\u4e8e\u300e\u6743\u9650\u300f\u65b9\u9762\u7684\u6982\u5ff5\uff01 \u56e0\u4e3a\u5728\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u7aef\u53ef\u80fd\u5fc5\u987b\u8981\u5177\u5907\u76f8\u540c\u7684\u8d26\u53f7\u624d\u80fd\u591f\u5b58\u53d6\u67d0\u4e9b\u76ee\u5f55\u6216\u6863\u6848\u3002 \u53e6\u5916\uff0cNFS \u7684\u542f\u52a8\u9700\u8981\u900f\u8fc7\u6240\u8c13\u7684\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528 (RPC)\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u5e76\u4e0d\u662f\u53ea\u8981\u542f\u52a8 NFS \u5c31\u597d\u4e86\uff0c \u8fd8\u9700\u8981\u542f\u52a8 RPC \u8fd9\u4e2a\u670d\u52a1\u624d\u884c\u554a\uff01\u56e0\u6b64\uff0c\u5728\u5f00\u59cb\u8fdb\u884c NFS \u7684\u8bbe\u5b9a\u4e4b\u524d\uff0c\u6211\u4eec\u5f97\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\uff0c\u4ec0\u4e48\u662f NFS \u5462\uff1f\u4e0d\u7136\u8bb2\u4e86\u4e00\u5806\u4e5f\u6ca1\u6709\u7528\uff0c\u5bf9\u5427\uff01 ^_^\uff01 \u5e95\u4e0b\u5c31\u6765\u8c08\u4e00\u8c08\u4ec0\u4e48\u662f NFS_nfs \u6587\u4ef6\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/29063.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T21:26:28+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419212619-680414fb8da10.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"21 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/29063.html","url":"https:\/\/www.wsisp.com\/helps\/29063.html","name":"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T21:26:28+00:00","dateModified":"2025-04-19T21:26:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/29063.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/29063.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/29063.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c\u5341\u4e09\u7ae0\u3001\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u4e00\uff1aNFS \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\/29063","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=29063"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/29063\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/29043"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=29063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=29063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=29063"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=29063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}