{"id":173798,"date":"2020-03-13T10:00:53","date_gmt":"2020-03-13T02:00:53","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=173798"},"modified":"2020-03-02T10:18:16","modified_gmt":"2020-03-02T02:18:16","slug":"explain-etc-passwd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/explain-etc-passwd.html","title":{"rendered":"\u8be6\u89e3Linux\u4e2d\/etc\/passwd\u6587\u4ef6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728Linux \/etc\/passwd\u6587\u4ef6\u4e2d\u6bcf\u4e2a\u7528\u6237\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u8bb0\u5f55\u884c\uff0c\u5b83\u8bb0\u5f55\u4e86\u8fd9\u4e2a\u7528\u6237\u7684\u4e00\u4e9b\u57fa\u672c\u5c5e\u6027\u3002\u7cfb\u7edf\u7ba1\u7406\u5458\u7ecf\u5e38\u4f1a\u63a5\u89e6\u5230\u8fd9\u4e2a\u6587\u4ef6\u7684\u4fee\u6539\u4ee5\u5b8c\u6210\u5bf9\u7528\u6237\u7684\u7ba1\u7406\u5de5\u4f5c\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u5b83\u7684\u5185\u5bb9\u7c7b\u4f3c\u4e0b\u9762\u7684\u4f8b\u5b50\uff1a<\/p>\n

\"\"<\/p>\n

\u4ece\u4e0a\u9762\u7684\u4f8b\u5b50\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\/etc\/passwd\u4e2d\u4e00\u884c\u8bb0\u5f55\u5bf9\u5e94\u7740\u4e00\u4e2a\u7528\u6237\uff0c\u6bcf\u884c\u8bb0\u5f55\u53c8\u88ab\u5192\u53f7(:)\u5206\u9694\u4e3a7\u4e2a\u5b57\u6bb5\uff0c\u5176\u683c\u5f0f\u548c\u5177\u4f53\u542b\u4e49\u5982\u4e0b\uff1a<\/p>\n

\u7528\u6237\u540d:\u53e3\u4ee4:\u7528\u6237\u6807\u8bc6\u53f7:\u7ec4\u6807\u8bc6\u53f7:\u6ce8\u91ca\u6027\u63cf\u8ff0:\u4e3b\u76ee\u5f55:\u767b\u5f55Shell<\/p>\n

\u201c\u7528\u6237\u540d\u201d<\/strong><\/span><\/div>\n

\u4ee3\u8868\u7528\u6237\u8d26\u53f7\u7684\u5b57\u7b26\u4e32\u3002\u901a\u5e38\u957f\u5ea6\u4e0d\u8d85\u8fc78\u4e2a\u5b57\u7b26\uff0c\u5e76\u4e14\u7531\u5927\u5c0f\u5199\u5b57\u6bcd\u548c\/\u6216\u6570\u5b57\u7ec4\u6210\u3002\u767b\u5f55\u540d\u4e2d\u4e0d\u80fd\u6709\u5192\u53f7(:)\uff0c\u56e0\u4e3a\u5192\u53f7\u5728\u8fd9\u91cc\u662f\u5206\u9694\u7b26\u3002\u4e3a\u4e86\u517c\u5bb9\u8d77\u89c1\uff0c\u767b\u5f55\u540d\u4e2d\u6700\u597d\u4e0d\u8981\u5305\u542b\u70b9\u5b57\u7b26(.)\uff0c\u5e76\u4e14\u4e0d\u4f7f\u7528\u8fde\u5b57\u7b26(-)\u548c\u52a0\u53f7(+)\u6253\u5934\u3002<\/p>\n

\u201c\u53e3\u4ee4\u201d<\/strong><\/span><\/div>\n

\u4e00\u4e9b\u7cfb\u7edf\u4e2d\uff0c\u5b58\u653e\u7740\u52a0\u5bc6\u540e\u7684\u7528\u6237\u53e3\u4ee4\u5b57\u3002\u867d\u7136\u8fd9\u4e2a\u5b57\u6bb5\u5b58\u653e\u7684\u53ea\u662f\u7528\u6237\u53e3\u4ee4\u7684\u52a0\u5bc6\u4e32\uff0c\u4e0d\u662f\u660e\u6587\uff0c\u4f46\u662f\u7531\u4e8e\/etc\/passwd\u6587\u4ef6\u5bf9\u6240\u6709\u7528\u6237\u90fd\u53ef\u8bfb\uff0c\u6240\u4ee5\u8fd9\u4ecd\u662f\u4e00\u4e2a\u5b89\u5168\u9690\u60a3\u3002\u56e0\u6b64\uff0c\u73b0\u5728\u8bb8\u591aLinux\u7cfb\u7edf\uff08\u5982SVR4\uff09\u90fd\u4f7f\u7528\u4e86shadow\u6280\u672f\uff0c\u628a\u771f\u6b63\u7684\u52a0\u5bc6\u540e\u7684\u7528\u6237\u53e3\u4ee4\u5b57\u5b58\u653e\u5230\/etc\/shadow\u6587\u4ef6\u4e2d\uff0c\u800c\u5728\/etc\/passwd\u6587\u4ef6\u7684\u53e3\u4ee4\u5b57\u6bb5\u4e2d\u53ea\u5b58\u653e\u4e00\u4e2a\u7279\u6b8a\u7684\u5b57\u7b26\uff0c\u4f8b\u5982\u201cx\u201d\u6216\u8005\u201c*\u201d\u3002<\/p>\n

\u201c\u7528\u6237\u6807\u8bc6\u53f7\u201d<\/strong><\/span><\/div>\n

\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u7cfb\u7edf\u5185\u90e8\u7528\u5b83\u6765\u6807\u8bc6\u7528\u6237\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\u5b83\u4e0e\u7528\u6237\u540d\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\u3002\u5982\u679c\u51e0\u4e2a\u7528\u6237\u540d\u5bf9\u5e94\u7684\u7528\u6237\u6807\u8bc6\u53f7\u662f\u4e00\u6837\u7684\uff0c\u7cfb\u7edf\u5185\u90e8\u5c06\u628a\u5b83\u4eec\u89c6\u4e3a\u540c\u4e00\u4e2a\u7528\u6237\uff0c\u4f46\u662f\u5b83\u4eec\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u53e3\u4ee4\u3001\u4e0d\u540c\u7684\u4e3b\u76ee\u5f55\u4ee5\u53ca\u4e0d\u540c\u7684\u767b\u5f55Shell\u7b49\u3002\u901a\u5e38\u7528\u6237\u6807\u8bc6\u53f7\u7684\u53d6\u503c\u8303\u56f4\u662f0\uff5e65535\u30020\u662f\u8d85\u7ea7\u7528\u6237root\u7684\u6807\u8bc6\u53f7\uff0c1\uff5e99\u7531\u7cfb\u7edf\u4fdd\u7559\uff0c\u4f5c\u4e3a\u7ba1\u7406\u8d26\u53f7\uff0c\u666e\u901a\u7528\u6237\u7684\u6807\u8bc6\u53f7\u4ece100\u5f00\u59cb\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u8fd9\u4e2a\u754c\u9650\u662f500\u3002<\/p>\n

\u201c\u7ec4\u6807\u8bc6\u53f7\u201d<\/strong><\/span><\/div>\n

\u5b57\u6bb5\u8bb0\u5f55\u7684\u662f\u7528\u6237\u6240\u5c5e\u7684\u7528\u6237\u7ec4\u3002\u5b83\u5bf9\u5e94\u7740\/etc\/group\u6587\u4ef6\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\u3002<\/p>\n

\u201c\u6ce8\u91ca\u6027\u63cf\u8ff0\u201d<\/strong><\/span><\/div>\n

\u5b57\u6bb5\u8bb0\u5f55\u7740\u7528\u6237\u7684\u4e00\u4e9b\u4e2a\u4eba\u60c5\u51b5\uff0c\u4f8b\u5982\u7528\u6237\u7684\u771f\u5b9e\u59d3\u540d\u3001\u7535\u8bdd\u3001\u5730\u5740\u7b49\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u5e76\u6ca1\u6709\u4ec0\u4e48\u5b9e\u9645\u7684\u7528\u9014\u3002\u5728\u4e0d\u540c\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u7684\u683c\u5f0f\u5e76\u6ca1\u6709\u7edf\u4e00\u3002\u5728\u8bb8\u591aLinux\u7cfb\u7edf\u4e2d\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u5b58\u653e\u7684\u662f\u4e00\u6bb5\u4efb\u610f\u7684\u6ce8\u91ca\u6027\u63cf\u8ff0\u6587\u5b57\uff0c\u7528\u505afinger\u547d\u4ee4\u7684\u8f93\u51fa\u3002<\/p>\n

\u201c\u4e3b\u76ee\u5f55\u201d<\/strong><\/span><\/div>\n

\u4e5f\u5c31\u662f\u7528\u6237\u7684\u8d77\u59cb\u5de5\u4f5c\u76ee\u5f55\uff0c\u5b83\u662f\u7528\u6237\u5728\u767b\u5f55\u5230\u7cfb\u7edf\u4e4b\u540e\u6240\u5904\u7684\u76ee\u5f55\u3002\u5728\u5927\u591a\u6570\u7cfb\u7edf\u4e2d\uff0c\u5404\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u90fd\u88ab\u7ec4\u7ec7\u5728\u540c\u4e00\u4e2a\u7279\u5b9a\u7684\u76ee\u5f55\u4e0b\uff0c\u800c\u7528\u6237\u4e3b\u76ee\u5f55\u7684\u540d\u79f0\u5c31\u662f\u8be5\u7528\u6237\u7684\u767b\u5f55\u540d\u3002<\/p>\n

\u5404\u7528\u6237\u5bf9\u81ea\u5df1\u7684\u4e3b\u76ee\u5f55\u6709\u8bfb\u3001\u5199\u3001\u6267\u884c\uff08\u641c\u7d22\uff09\u6743\u9650\uff0c\u5176\u4ed6\u7528\u6237\u5bf9\u6b64\u76ee\u5f55\u7684\u8bbf\u95ee\u6743\u9650\u5219\u6839\u636e\u5177\u4f53\u60c5\u51b5\u8bbe\u7f6e\u3002\u7528\u6237\u767b\u5f55\u540e\uff0c\u8981\u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u8d1f\u8d23\u5c06\u7528\u6237\u7684\u64cd\u4f5c\u4f20\u7ed9\u5185\u6838\uff0c\u8fd9\u4e2a\u8fdb\u7a0b\u662f\u7528\u6237\u767b\u5f55\u5230\u7cfb\u7edf\u540e\u8fd0\u884c\u7684\u547d\u4ee4\u89e3\u91ca\u5668\u6216\u67d0\u4e2a\u7279\u5b9a\u7684\u7a0b\u5e8f\uff0c\u5373Shell\u3002Shell\u662f\u7528\u6237\u4e0eLinux\u7cfb\u7edf\u4e4b\u95f4\u7684\u63a5\u53e3\u3002Linux\u7684Shell\u6709\u8bb8\u591a\u79cd\uff0c\u6bcf\u79cd\u90fd\u6709\u4e0d\u540c\u7684\u7279\u70b9\u3002<\/p>\n

\u5e38\u7528\u7684\u6709sh(BourneShell),csh(CShell),ksh(KornShell),tcsh(TENEX\/TOPS-20typeCShell),bash(BourneAgainShell)\u7b49\u3002<\/p>\n

\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u6839\u636e\u7cfb\u7edf\u60c5\u51b5\u548c\u7528\u6237\u4e60\u60ef\u4e3a\u7528\u6237\u6307\u5b9a\u67d0\u4e2aShell\u3002\u5982\u679c\u4e0d\u6307\u5b9aShell\uff0c\u90a3\u4e48\u7cfb\u7edf\u4f7f\u7528sh\u4e3a\u9ed8\u8ba4\u7684\u767b\u5f55Shell\uff0c\u5373\u8fd9\u4e2a\u5b57\u6bb5\u7684\u503c\u4e3a\/bin\/sh\u3002\u7528\u6237\u7684\u767b\u5f55Shell\u4e5f\u53ef\u4ee5\u6307\u5b9a\u4e3a\u67d0\u4e2a\u7279\u5b9a\u7684\u7a0b\u5e8f\uff08\u6b64\u7a0b\u5e8f\u4e0d\u662f\u4e00\u4e2a\u547d\u4ee4\u89e3\u91ca\u5668\uff09\u3002<\/p>\n

\u5229\u7528\u8fd9\u4e00\u7279\u70b9\uff0c\u6211\u4eec\u53ef\u4ee5\u9650\u5236\u7528\u6237\u53ea\u80fd\u8fd0\u884c\u6307\u5b9a\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5728\u8be5\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u7ed3\u675f\u540e\uff0c\u7528\u6237\u5c31\u81ea\u52a8\u9000\u51fa\u4e86\u7cfb\u7edf\u3002\u6709\u4e9bLinux\u7cfb\u7edf\u8981\u6c42\u53ea\u6709\u90a3\u4e9b\u5728\u7cfb\u7edf\u4e2d\u767b\u8bb0\u4e86\u7684\u7a0b\u5e8f\u624d\u80fd\u51fa\u73b0\u5728\u8fd9\u4e2a\u5b57\u6bb5\u4e2d\u3002\u7cfb\u7edf\u4e2d\u6709\u4e00\u7c7b\u7528\u6237\u79f0\u4e3a\u4f2a\u7528\u6237\uff08psuedousers\uff09\uff0c\u8fd9\u4e9b\u7528\u6237\u5728Linux \/etc\/passwd\u6587\u4ef6\u4e2d\u4e5f\u5360\u6709\u4e00\u6761\u8bb0\u5f55\uff0c\u4f46\u662f\u4e0d\u80fd\u767b\u5f55\uff0c\u56e0\u4e3a\u5b83\u4eec\u7684\u767b\u5f55Shell\u4e3a\u7a7a\u3002\u5b83\u4eec\u7684\u5b58\u5728\u4e3b\u8981\u662f\u65b9\u4fbf\u7cfb\u7edf\u7ba1\u7406\uff0c\u6ee1\u8db3\u76f8\u5e94\u7684\u7cfb\u7edf\u8fdb\u7a0b\u5bf9\u6587\u4ef6\u5c5e\u4e3b\u7684\u8981\u6c42\u3002\u5e38\u89c1\u7684\u4f2a\u7528\u6237\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

\u4f2a\u7528\u6237\u542b\u4e49<\/strong><\/span><\/div>\n

\u5305\u62ec\uff1a<\/p>\n

bin \u62e5\u6709\u53ef\u6267\u884c\u7684\u7528\u6237\u547d\u4ee4\u6587\u4ef6<\/p>\n

sys \u62e5\u6709\u7cfb\u7edf\u6587\u4ef6<\/p>\n

adm \u62e5\u6709\u5e10\u6237\u6587\u4ef6<\/p>\n

uucp UUCP\u4f7f\u7528<\/p>\n

lplp\u6216lpd \u5b50\u7cfb\u7edf\u4f7f\u7528<\/p>\n

nobody NFS\u4f7f\u7528<\/p>\n

\u62e5\u6709\u5e10\u6237\u6587\u4ef6<\/p>\n

\u9664\u4e86\u4e0a\u9762\u5217\u51fa\u7684\u4f2a\u7528\u6237\u5916\uff0c\u8fd8\u6709\u8bb8\u591a\u6807\u51c6\u7684\u4f2a\u7528\u6237\uff0c\u4f8b\u5982\uff1aaudit,cron,mail,usenet\u7b49\uff0c\u5b83\u4eec\u4e5f\u90fd\u5404\u81ea\u4e3a\u76f8\u5173\u7684\u8fdb\u7a0b\u548c\u6587\u4ef6\u6240\u9700\u8981\u3002<\/p>\n

\u7531\u4e8eLinux \/etc\/passwd\u6587\u4ef6\u662f\u6240\u6709\u7528\u6237\u90fd\u53ef\u8bfb\u7684\uff0c\u5982\u679c\u7528\u6237\u7684\u5bc6\u7801\u592a\u7b80\u5355\u6216\u89c4\u5f8b\u6bd4\u8f83\u660e\u663e\u7684\u8bdd\uff0c\u4e00\u53f0\u666e\u901a\u7684\u8ba1\u7b97\u673a\u5c31\u80fd\u591f\u5f88\u5bb9\u6613\u5730\u5c06\u5b83\u7834\u89e3\uff0c\u56e0\u6b64\u5bf9\u5b89\u5168\u6027\u8981\u6c42\u8f83\u9ad8<\/p>\n

\u7684Linux\u7cfb\u7edf\u90fd\u628a\u52a0\u5bc6\u540e\u7684\u53e3\u4ee4\u5b57\u5206\u79bb\u51fa\u6765\uff0c\u5355\u72ec\u5b58\u653e\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\/etc\/shadow\u6587\u4ef6\u3002\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u624d\u62e5\u6709\u8be5\u6587\u4ef6\u8bfb\u6743\u9650\uff0c\u8fd9\u5c31\u4fdd\u8bc1\u4e86\u7528\u6237\u5bc6\u7801\u7684\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5b83\u7684\u5185\u5bb9\u7c7b\u4f3c\u4e0b\u9762\u7684\u4f8b\u5b50\uff1a \u4ece\u4e0a\u9762\u7684\u4f8b\u5b50\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\/etc\/passwd\u4e2d\u4e00\u884c\u8bb0\u5f55\u5bf9\u5e94\u7740\u4e00\u4e2a\u7528\u6237\uff0c\u6bcf\u884c\u8bb0\u5f55\u53c8 […]<\/p>\n","protected":false},"author":310,"featured_media":173811,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-173798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=173798"}],"version-history":[{"count":13,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173798\/revisions"}],"predecessor-version":[{"id":173926,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173798\/revisions\/173926"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/173811"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=173798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=173798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=173798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}