{"id":118,"date":"2008-08-04T09:26:29","date_gmt":"2008-08-04T09:26:29","guid":{"rendered":""},"modified":"2008-08-04T09:26:29","modified_gmt":"2008-08-04T09:26:29","slug":"","status":"publish","type":"post","link":"https:\/\/www.inbreak.net\/archives\/118.html","title":{"rendered":"\u300e\u8f6c\u8f7d\u300fLinux \u7cfb\u7edf\u4e2d\u7684\u8d85\u7ea7\u6743\u9650\u7684\u63a7\u5236"},"content":{"rendered":"
\u4f5c\u8005\uff1a<\/strong>\u5317\u5357\u5357\u5317 \u6458\u8981\uff1a<\/strong> \u8d85\u7ea7\u7528\u6237\u662f\u7cfb\u7edf\u6700\u9ad8\u6743\u9650\u7684\u62e5\u6709\u8005\uff0c\u662f\u7cfb\u7edf\u7ba1\u7406\u552f\u4e00\u7684\u80dc\u4efb\u8005\uff1b\u7531\u4e8e\u6743\u9650\u7684\u8d85\u7ea7\u5e76\u4e14\u8fbe\u5230\u65e0\u6240\u4e0d\u80fd\u7684\u5730\u6b65\uff0c\u5982\u679c\u7ba1\u7406\u4e0d\u64c5\uff0c\u5fc5\u4f1a\u5bf9\u7cfb\u7edf\u5b89\u5168\u9020\u6210\u5a01\u80c1\u3002 \u9664\u4e86\u5c3d\u53ef\u80fd\u7684\u907f\u514d\u7528\u76f4\u63a5\u7528\u8d85\u7ea7\u7528\u6237root\u767b\u5f55\u7cfb\u7edf\u5916\uff0c\u6211\u4eec\u8fd8\u8981\u5b66\u4f1a\u5728\u666e\u901a\u7528\u6237\u4e0b\u4e34\u65f6\u5207\u6362\u5230\u8d85\u7ea7\u7528\u6237root\u4e0b\u5b8c\u6210\u5fc5\u8981\u7684\u7cfb\u7edf\u7ba1\u7406\u5de5\u4f5c\uff1b\u4ece\u7528\u6237\u7ba1\u7406\u548c\u7cfb\u7edf\u5b89\u5168\u89d2\u5ea6\u6765\u8bf4\u662f\u6781\u6709\u610f\u4e49\u7684\uff1b<\/p>\n \u672c\u6587\u5bf9\u666e\u901a\u7528\u6237\u5207\u6362\u5230root\u7528\u6237\u7684\u5b9e\u73b0\u547d\u4ee4 su \u548csudo \u505a\u4e86\u5b9e\u4f8b\u89e3\u8bf4\uff1b\u5e0c\u671b\u80fd\u4e3a\u521d\u5b66\u8005\u5b66\u4e60\u5e26\u6765\u65b9\u4fbf\uff1b<\/p>\n \u4e00\u3001\u5bf9\u8d85\u7ea7\u7528\u6237\u548c\u666e\u901a\u7528\u6237\u7684\u7406\u89e3\uff1b<\/strong><\/a><\/p>\n \u4e8c. \u8d85\u7ea7\u7528\u6237\uff08\u6743\u9650\uff09\u5728\u7cfb\u7edf\u7ba1\u7406\u4e2d\u7684\u4f5c\u7528<\/strong><\/a><\/p>\n \u4e09\u3001\u4f7f\u7528 su \u547d\u4ee4\u4e34\u65f6\u5207\u6362\u7528\u6237\u8eab\u4efd\uff1b<\/strong><\/a><\/p>\n \u56db\u3001sudo \u6388\u6743\u8bb8\u53ef\u4f7f\u7528\u7684su\uff0c\u4e5f\u662f\u53d7\u9650\u5236\u7684su<\/strong><\/a><\/p>\n \u4e94\u3001\u540e\u8bb0\uff1b<\/strong><\/a> \u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0croot\u7684\u6743\u9650\u662f\u6700\u9ad8\u7684\uff0c\u4e5f\u88ab\u79f0\u4e3a\u8d85\u7ea7\u6743\u9650\u7684\u62e5\u6709\u8005\u3002\u666e\u901a\u7528\u6237\u65e0\u6cd5\u6267\u884c\u7684\u64cd\u4f5c\uff0croot\u7528\u6237\u90fd\u80fd\u5b8c\u6210\uff0c\u6240\u4ee5\u4e5f\u88ab\u79f0\u4e4b\u4e3a\u8d85\u7ea7\u7ba1\u7406\u7528\u6237\u3002<\/p>\n \u5728\u7cfb\u7edf\u4e2d\uff0c\u6bcf\u4e2a\u6587\u4ef6\u3001\u76ee\u5f55\u548c\u8fdb\u7a0b\uff0c\u90fd\u5f52\u5c5e\u4e8e\u67d0\u4e00\u4e2a\u7528\u6237\uff0c\u6ca1\u6709\u7528\u6237\u8bb8\u53ef\u5176\u5b83\u666e\u901a\u7528\u6237\u662f\u65e0\u6cd5\u64cd\u4f5c\u7684\uff0c\u4f46\u5bf9root\u9664\u5916\u3002root\u7528\u6237\u7684\u7279\u6743\u6027\u8fd8\u8868\u73b0\u5728root\u53ef\u4ee5\u8d85\u8d8a\u4efb\u4f55\u7528\u6237\u548c\u7528\u6237\u7ec4\u6765\u5bf9\u6587\u4ef6\u6216\u76ee\u5f55\u8fdb\u884c\u8bfb\u53d6\u3001\u4fee\u6539\u6216\u5220\u9664\uff08\u5728\u7cfb\u7edf\u6b63\u5e38\u7684\u8bb8\u53ef\u8303\u56f4\u5185\uff09\uff1b\u5bf9\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u6267\u884c\u3001\u7ec8\u6b62\uff1b\u5bf9\u786c\u4ef6\u8bbe\u5907\u7684\u6dfb\u52a0\u3001\u521b\u5efa\u548c\u79fb\u9664\u7b49\uff1b\u4e5f\u53ef\u4ee5\u5bf9\u6587\u4ef6\u548c\u76ee\u5f55\u8fdb\u884c\u5c5e\u4e3b\u548c\u6743\u9650\u8fdb\u884c\u4fee\u6539\uff0c\u4ee5\u9002\u5408\u7cfb\u7edf\u7ba1\u7406\u7684\u9700\u8981\uff08\u56e0\u4e3aroot\u662f\u7cfb\u7edf\u4e2d\u6743\u9650\u6700\u9ad8\u7684\u7279\u6743\u7528\u6237\uff09\uff1b<\/p>\n
\n\u8d5e\u52a9\uff1a<\/strong> eTony\uff0cpandonny\uff0c\u61d2\u732b\uff0c Arch
\n\u6765\u81ea\uff1a<\/strong>LinuxSir.Org<\/p>\n
\n\u76ee\u5f55\u7d22\u5f15
\n<\/strong><\/font><\/p>\n1\u3001\u4ec0\u4e48\u662f\u8d85\u7ea7\u7528\u6237\uff1b<\/a>
\n 2\u3001\u7406\u89e3 UID \u548c\u7528\u6237\u7684\u5bf9\u5e94\u5173\u7cfb<\/a>
\n 3\u3001\u666e\u901a\u7528\u6237\u548c\u4f2a\u88c5\u7528\u6237<\/a> <\/ul>\n1\u3001\u5bf9\u4efb\u4f55\u6587\u4ef6\u3001\u76ee\u5f55\u6216\u8fdb\u7a0b\u8fdb\u884c\u64cd\u4f5c\uff1b<\/a>
\n 2\u3001\u5bf9\u4e8e\u6d89\u53ca\u7cfb\u7edf\u5168\u5c40\u7684\u7cfb\u7edf\u7ba1\u7406\uff1b<\/a>
\n 3\u3001\u8d85\u7ea7\u6743\u9650\u7684\u4e0d\u53ef\u66ff\u4ee3\u6027\uff1b<\/a> <\/ul>\n1\u3001su \u7684\u9002\u7528\u6761\u4ef6\u548c\u5a01\u529b\uff1b<\/a>
\n 2\u3001su \u7684\u7528\u6cd5\uff1b<\/a>
\n 3\u3001su \u7684\u8303\u4f8b\uff1b<\/a>
\n 4\u3001su \u7684\u4f18\u7f3a\u70b9<\/a> <\/ul>\n1. sudo \u7684\u9002\u7528\u6761\u4ef6\uff1b<\/a>
\n 2\u3001\u4ece\u7f16\u5199 sudo \u914d\u7f6e\u6587\u4ef6\/etc\/sudoers\u5f00\u59cb\uff1b<\/a>
\n 3\u3001\/etc\/sudoers \u914d\u7f6e\u6587\u4ef6\u4e2d\u522b\u540d\u89c4\u5219<\/a>
\n 4\u3001\/etc\/sudoers\u4e2d\u7684\u6388\u6743\u89c4\u5219\uff1a<\/a>
\n 5\u3001\/etc\/sudoers\u4e2d\u5176\u5b83\u7684\u672a\u5c3d\u4e8b\u9879\uff1b<\/a>
\n 6\u3001sudo\u7684\u7528\u6cd5\uff1b<\/a> <\/ul>\n
\n \u516d\u3001\u5173\u4e8e\u672c\u6587\uff1b<\/strong><\/a>
\n \u4e03\u3001\u81f4\u8c22\uff1b<\/strong><\/a>
\n \u516b\u3001\u53c2\u8003\u6587\u6863\uff1b<\/strong><\/a>
\n \u4e5d\u3001\u76f8\u5173\u6587\u6863\uff1b<\/strong><\/a><\/p>\n
\n +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\n \u6b63\u6587
\n +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\n <\/strong><\/font><\/p>\n