{"id":47059,"date":"2023-05-29T09:59:37","date_gmt":"2023-05-29T01:59:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=47059"},"modified":"2023-05-29T09:59:37","modified_gmt":"2023-05-29T01:59:37","slug":"sudo-skills","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sudo-skills.html","title":{"rendered":"Linux\u4e2d\u8bbe\u7f6e’sudo’\u768410\u4e2a\u5c0f\u6280\u5de7"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5728Linux\u548c\u5176\u4ed6\u7c7bUnix\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u53ea\u6709root\u7528\u6237\u53ef\u4ee5\u8fd0\u884c\u6240\u6709\u547d\u4ee4\u5e76\u5728\u7cfb\u7edf\u4e0a\u6267\u884c\u67d0\u4e9b\u5173\u952e\u64cd\u4f5c\uff0c\u5982\u5b89\u88c5\u548c\u66f4\u65b0\uff0c\u5220\u9664\u5305\uff0c\u521b\u5efa\u7528\u6237\u548c\u7ec4\uff0c\u4fee\u6539\u91cd\u8981\u7684\u7cfb\u7edf\u914d\u7f6e\u6587\u4ef6\u7b49\u3002<\/strong>\u7136\u800c\uff0c\u627f\u62c5root\u7528\u6237\u89d2\u8272\u7684\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u5141\u8bb8\u5176\u4ed6\u6b63\u5e38\u7cfb\u7edf\u7528\u6237\u5728sudo\u547d\u4ee4\u548c\u51e0\u4e2a\u914d\u7f6e\u7684\u5e2e\u52a9\u4e0b\u8fd0\u884c\u67d0\u4e9b\u547d\u4ee4\u4ee5\u53ca\u6267\u884c\u5305\u62ec\u4e0a\u8ff0\u7684\u4e00\u4e9b\u91cd\u8981\u7cfb\u7edf\u64cd\u4f5c\u3002\u6216\u8005\uff0c\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u4ee5\u5171\u4eabroot\u7528\u6237\u5bc6\u7801\uff08\u8fd9\u4e0d\u662f\u63a8\u8350\u7684\u65b9\u6cd5\uff09\uff0c\u4ee5\u4fbf\u6b63\u5e38\u7cfb\u7edf\u7528\u6237\u53ef\u4ee5\u901a\u8fc7su\u547d\u4ee4\u8bbf\u95eeroot\u7528\u6237\u5e10\u6237\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n sudo\u5141\u8bb8\u7528\u6237\u4ee5root\u7528\u6237\u8eab\u4efd\uff08\u6216\u53e6\u4e00\u4e2a\u7528\u6237\uff09\u6267\u884c\u5b89\u5168\u7b56\u7565\u6307\u5b9a\u7684\u547d\u4ee4\uff1a\u5b83\u8bfb\u53d6\u5e76\u89e3\u6790\/etc sudoers\uff0c\u67e5\u627e\u8c03\u7528\u7684\u7528\u6237\u53ca\u5176\u6743\u9650\uff0c\u7136\u540e\u63d0\u793a\u8c03\u7528\u7528\u6237\u8f93\u5165\u5bc6\u7801\uff08\u901a\u5e38\u662f\u7528\u6237\u7684\u5bc6\u7801\uff0c\u4f46\u4e5f\u53ef\u4ee5\u662f\u76ee\u6807\u7528\u6237\u7684\u5bc6\u7801\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528NOPASSWD\u53d6\u6d88\u5bc6\u7801\u9a8c\u8bc1\uff09\uff0c\u4e4b\u540e\uff0csudo\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b\uff0c\u5728\u5176\u4e2d\u8c03\u7528setuid\uff08\uff09\u5207\u6362\u5230\u76ee\u6807\u7528\u6237next\uff0c\u5b83\u6267\u884c\u4e00\u4e2ashell\u6216\u5728\u4e0a\u9762\u7684\u5b50\u8fdb\u7a0b\u4e2d\u4f5c\u4e3a\u53c2\u6570\u7ed9\u51fa\u7684\u547d\u4ee4\u3002 sudo cat \/etc\/sudoers | less<\/pre>\n |