{"id":10131,"date":"2022-08-17T10:00:03","date_gmt":"2022-08-17T02:00:03","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=10131"},"modified":"2022-08-18T01:22:37","modified_gmt":"2022-08-17T17:22:37","slug":"sudo","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sudo.html","title":{"rendered":"\u8f93\u9519\u5bc6\u7801\uff1f\u8fd9\u4e2a sudo \u4f1a\u201c\u5632\u8bbd\u201d\u4f60"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f60\u5728 Linux \u7ec8\u7aef\u4e2d\u4f1a\u6709\u5f88\u591a\u7684\u4e50\u8da3\u3002\u6211\u4eca\u5929\u8981\u8bb2\u7684\u4e0d\u662f\u5728\u7ec8\u7aef\u4e2d\u8dd1\u706b\u8f66\u3002\u6211\u4eca\u5929\u8981\u8bb2\u7684\u6280\u5de7\u53ef\u4ee5\u653e\u677e\u4f60\u7684\u5fc3\u60c5\u3002\u4f60\u5b66\u4e60\u8fc7\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u589e\u52a0 sudo \u547d\u4ee4\u7684\u8d85\u65f6,\u4eca\u5929\u7684\u6587\u7ae0\u4e2d\uff0c\u6211\u4f1a\u5411\u4f60\u5c55\u793a\u5982\u4f55\u8ba9 sudo \u5728\u8f93\u9519\u5bc6\u7801\u7684\u65f6\u5019\u201c\u5632\u8bbd\u201d\u4f60\uff08\u6216\u8005\u5176\u4ed6\u4eba\uff09\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"sudo1\"
\n\u5bf9\u6211\u8bb2\u7684\u611f\u5230\u7591\u60d1\uff1f\u8fd9\u91cc\uff0c\u8ba9\u6211\u4eec\u770b\u4e0b\u8fd9\u5f20 gif \u6765\u4e86\u89e3\u4e0b sudo \u662f\u5982\u4f55\u5728\u4f60\u8f93\u9519\u5bc6\u7801\u4e4b\u540e\u201c\u5632\u8bbd\u201d\u4f60\u7684\u3002
\n\"sudo2\"
\n\u90a3\u4e48\uff0c\u4e3a\u4ec0\u4e48\u8981\u8fd9\u4e48\u505a\uff1f\u6bd5\u7adf\uff0c\u201c\u5632\u8bbd\u201d\u4e0d\u4f1a\u8ba9\u4f60\u7684\u4e00\u5929\u53d8\u5f97\u5f00\u5fc3\uff0c\u4e0d\u662f\u4e48\uff1f
\n\u5bf9\u6211\u6765\u8bf4\uff0c\u4e00\u70b9\u5c0f\u6280\u5de7\u90fd\u662f\u6709\u8da3\u7684\uff0c\u5e76\u4e14\u8981\u6bd4\u4ee5\u524d\u7684\u201c\u5bc6\u7801\u9519\u8bef\u201d\u7684\u9519\u8bef\u63d0\u793a\u66f4\u6709\u8da3\u3002\u53e6\u5916\uff0c\u6211\u53ef\u4ee5\u5411\u6211\u7684\u670b\u53cb\u5c55\u793a\u6765\u9017\u5f04\u4ed6\u4eec\uff08\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u662f\u901a\u8fc7\u81ea\u7531\u5f00\u6e90\u8f6f\u4ef6\uff09\u3002\u6211\u5f88\u80af\u5b9a\u4f60\u6709\u4f60\u81ea\u5df1\u7684\u7406\u7531\u6765\u4f7f\u7528\u8fd9\u4e2a\u6280\u5de7\u7684\u3002<\/p>\n

\u5728 sudo \u4e2d\u542f\u7528\u201c\u5632\u8bbd\u201d<\/strong><\/div>\n

\u4f60\u53ef\u4ee5\u5728sudo\u914d\u7f6e\u4e2d\u589e\u52a0\u4e0b\u9762\u7684\u884c\u6765\u542f\u7528\u201c\u5632\u8bbd\u201d\u529f\u80fd\uff1a<\/p>\n

\r\n
Defaults insults<\/strong><\/span><\/div>\r\n<\/pre>\n

\u8ba9\u6211\u4eec\u770b\u770b\u8be5\u5982\u4f55\u505a\u3002\u6253\u5f00\u7ec8\u7aef\u5e76\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

\r\n
sudo visudo<\/strong><\/span><\/div>\r\n<\/pre>\n

\u8fd9\u4f1a\u5728 nano\u4e2d\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

\u662f\u7684\uff0c\u6211\u77e5\u9053\u4f20\u7edf\u7684 \u2018visudo\u2019 \u5e94\u8be5\u5728 vi \u4e2d\u6253\u5f00 \/etc\/sudoers \u6587\u4ef6\uff0c\u4f46\u662f Ubuntu \u53ca\u57fa\u4e8e\u5b83\u7684\u53d1\u884c\u7248\u4f1a\u4f7f\u7528 nano \u6253\u5f00\u3002\u7531\u4e8e\u6211\u4eec\u5728\u8ba8\u8bbavi\uff0c\u8fd9\u91cc\u6709\u4e00\u4efd vi \u901f\u67e5\u8868\u53ef\u4ee5\u5728\u4f60\u51b3\u5b9a\u4f7f\u7528 vi \u7684\u65f6\u5019\u4f7f\u7528\u3002<\/p>\n

\u56de\u5230\u7f16\u8f91 sudeors \u6587\u4ef6\u754c\u9762\uff0c\u4f60\u9700\u8981\u627e\u51fa Defaults \u6240\u5728\u7684\u884c\u3002\u7b80\u5355\u7684\u5f88\uff0c\u53ea\u9700\u8981\u5728\u6587\u4ef6\u7684\u5f00\u5934\u52a0\u4e0aDefaults insults\uff0c\u5c31\u50cf\u8fd9\u6837\uff1a
\n\"sudo3\"
\n\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528 nano\uff0c\u4f7f\u7528Ctrl+X\u6765\u9000\u51fa\u7f16\u8f91\u5668\u3002\u5728\u9000\u51fa\u7684\u65f6\u5019\uff0c\u5b83\u4f1a\u8be2\u95ee\u4f60\u662f\u5426\u4fdd\u5b58\u66f4\u6539\u3002\u8981\u4fdd\u5b58\u66f4\u6539\uff0c\u6309\u4e0b\u201cY\u201d\u3002
\n\u4e00\u65e6\u4f60\u4fdd\u5b58\u4e86 sudoers \u6587\u4ef6\u4e4b\u540e\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u4f7f\u7528 sudo \u8fd0\u884c\u5404\u79cd\u547d\u4ee4\u3002\u6545\u610f\u8f93\u9519\u5bc6\u7801\u5e76\u4eab\u53d7\u5632\u8bbd\u5427\uff1a\uff09
\nsudo \u53ef\u80fd\u4f1a\u751f\u6c14\u7684\u3002\u770b\u89c1\u6ca1\uff0c\u4ed6\u751a\u81f3\u5728\u6211\u518d\u6b21\u8f93\u9519\u4e4b\u540e\u5a01\u80c1\u6211\u3002
\n\"sudo4\"<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.linux.com<\/a><\/p>\n

\u8f6c\u8f7d\u5730\u5740\uff1ahttp:\/\/blog.chinaunix.net\/uid-7573623-id-2048961.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/sudo.html<\/a>\u7f16\u8f91\uff1a\u9648\u51e1\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u4f60\u5728 Linux \u7ec8\u7aef\u4e2d\u4f1a\u6709\u5f88\u591a\u7684\u4e50\u8da3\u3002\u6211\u4eca\u5929\u8981\u8bb2\u7684\u4e0d\u662f\u5728\u7ec8\u7aef\u4e2d\u8dd1\u706b\u8f66\u3002\u6211\u4eca\u5929\u8981\u8bb2\u7684\u6280\u5de7\u53ef\u4ee5\u653e\u677e\u4f60\u7684\u5fc3\u60c5 […]<\/p>\n","protected":false},"author":63,"featured_media":10297,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-10131","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\/10131","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=10131"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/10131\/revisions"}],"predecessor-version":[{"id":250467,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/10131\/revisions\/250467"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/10297"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=10131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=10131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=10131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}