{"id":293556,"date":"2024-10-11T04:04:36","date_gmt":"2024-10-10T20:04:36","guid":{"rendered":"https:\/\/lrxjmw.cn\/udkrzaqlyrqx.html"},"modified":"2024-10-11T04:04:36","modified_gmt":"2024-10-10T20:04:36","slug":"udkrzaqlyrqx","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/udkrzaqlyrqx.html","title":{"rendered":"ubuntu \u6253\u5f00root Ubuntu \u4e2d\u5b89\u5168\u5229\u7528 Root \u6743\u9650\u7684\u65b9\u6cd5\u4e0e\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"

\u5728Ubuntu\u8fd9\u4e00\u9ad8\u6548\u7387\u5f00\u6e90\u7cfb\u7edf\u4e2d\uff0cRoot\u6743\u9650\u53d1\u6325\u7740\u6838\u5fc3\u4f5c\u7528\u3002\u5b83\u76f8\u5f53\u4e8e\u4e00\u628a\u5f00\u542f\u7cfb\u7edf\u6838\u5fc3\u529f\u80fd\u7684\u94a5\u5319\uff0c\u5141\u8bb8\u7528\u6237\u6267\u884c\u9ad8\u7ea7\u914d\u7f6e\u3001\u8f6f\u4ef6\u5b89\u88c5\u53ca\u9ad8\u6743\u9650\u64cd\u4f5c\u3002\u5c3d\u7ba1\u5982\u6b64\uff0cUbuntu\u51fa\u4e8e\u5b89\u5168\u76ee\u7684\uff0c\u672a\u9ed8\u8ba4\u542f\u7528Root\u8d26\u6237\u767b\u5f55ubuntu \u6253\u5f00root<\/strong>\uff0c\u800c\u662f\u501f\u52a9sudo\u6765\u63a7\u5236\u6743\u9650\u3002\u672c\u6587\u5c06\u6df1\u5165\u8bb2\u89e3\u5982\u4f55\u5728Ubuntu\u4e2d\u5b89\u5168\u5730\u5229\u7528Root\u6743\u9650\u3002<\/p>\n

\u4e00\u3001\u7406\u89e3Root\u6743\u9650\u4e0esudo<\/b><\/p>\n

\u6d88\u9664\u666e\u904d\u6df7\u6dc6\uff1aUbuntu\u7cfb\u7edf\u4e0d\u6d89\u53ca\u201c\u6fc0\u6d3b\u201dRoot\u7528\u6237\uff0c\u800c\u662f\u5229\u7528sudo\u6307\u4ee4\u8d4b\u4e88\u7279\u5b9a\u64cd\u4f5cRoot\u6743\u9650\u3002\u76f4\u63a5\u4ee5Root\u8eab\u4efd\u767b\u5f55\u5b58\u5728\u663e\u8457\u5b89\u5168\u98ce\u9669\uff0c\u82e5Root\u8d26\u6237\u906d\u53d7\u6076\u610f\u8f6f\u4ef6\u653b\u51fb\uff0c\u7cfb\u7edf\u5b89\u5168\u5c06\u906d\u53d7\u4e25\u91cd\u5a01\u80c1\u3002sudo\u673a\u5236\u5219\u4f7f\u666e\u901a\u7528\u6237\u53ef\u6267\u884cRoot\u64cd\u4f5c\uff0c\u5e76\u8bb0\u5f55\u6240\u6709\u64cd\u4f5c\u8fc7\u7a0b\uff0c\u4fbf\u4e8e\u76d1\u63a7\u4e0e\u5ba1\u67e5\u3002<\/p>\n

\u4e8c\u3001\u542f\u7528Root\u8d26\u6237\uff08\u4e0d\u63a8\u8350\uff09<\/b><\/p>\n

\u5c3d\u7ba1\u4e0d\u5efa\u8bae\uff0c\u4f46\u5728\u7279\u5b9a\u5e94\u7528\u6216\u811a\u672c\u9700\u4ee5Root\u7528\u6237\u6267\u884c\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u6fc0\u6d3bRoot\u8d26\u6237\uff1a<\/p>\n

\u542f\u52a8\u7ec8\u7aef\uff1a\u8bf7\u5148\u5728Ubuntu\u7cfb\u7edf\u4e2d\u5f00\u542f\u7ec8\u7aef\uff0c\u53ef\u901a\u8fc7\u6309\u4e0bCtrl+Alt+T\u5feb\u6377\u952e\u5b9e\u73b0\u3002<\/p>\n

\u914d\u7f6eRoot\u5bc6\u7801\uff1a\u4e8e\u7ec8\u7aef\u6267\u884c`sudopasswdroot`\u6307\u4ee4\u5e76\u6309\u4e0bEnter\u3002\u7cfb\u7edf\u5c06\u8981\u6c42\u8f93\u5165\u73b0\u6709\u7528\u6237\u5bc6\u7801\u4ee5\u6838\u5b9e\u8eab\u4efd\u3002\u9a8c\u8bc1\u6210\u529f\u540eubuntu \u6253\u5f00root<\/strong>\uff0c\u9700\u4e3a\u65b0Root\u8d26\u53f7\u8bbe\u5b9a\u5bc6\u7801\u3002\u8bf7\u9009\u4e00\u4e2a\u5f3a\u5ea6\u9ad8\u7684\u5bc6\u7801\uff0c\u4ee5\u52a0\u5f3a\u7cfb\u7edf\u5b89\u4fdd\u3002<\/p>\n

\u8f6c\u5165Root\u8d26\u53f7\uff08\u975e\u65e5\u5e38\u63a8\u8350\uff09\uff1a\u5b8c\u6210\u5bc6\u7801\u914d\u7f6e\u540e\uff0c\u8f93\u5165`su`\u547d\u4ee4<\/a>\u5e76\u952e\u5165\u65b0\u8bbeRoot\u5bc6\u7801\u5373\u53ef\u5207\u6362\u3002\u4f46\u8bf7\u6ce8\u610f\uff0c\u4ec5\u5728\u5fc5\u8981\u65f6\u4ee5Root\u8eab\u4efd\u767b\u5f55\u6216\u64cd\u4f5c\u3002<\/p>\n

\u4e09\u3001\u4f7f\u7528sudo\u6267\u884c\u547d\u4ee4<\/b><\/p>\n

\u5728\u5e38\u89c4\u64cd\u4f5c\u4e2d\uff0csudo\u662f\u63a8\u8350\u7528\u4e8e\u8fd0\u884c\u9700Root\u6743\u9650\u7684\u6307\u4ee4\u3002\u8be5\u65b9\u6848\u7684\u4f18\u52bf\u5728\u4e8e\uff0c\u65e0\u9700\u77e5\u6653Root\u5bc6\u7801linux mint\uff0c\u540c\u65f6sudo\u80fd\u81ea\u52a8\u8bb0\u5f55\u6240\u6709\u4ee5Root\u8eab\u4efd\u6267\u884c\u7684\u6307\u4ee4\uff0c\u4fbf\u4e8e\u7cfb\u7edf\u7ef4\u62a4\u4e0e\u5b89\u5168\u5ba1\u67e5\u3002<\/p>\n

\u57fa\u7840\u64cd\u4f5c\uff1a\u901a\u8fc7\u524d\u7f6e`sudo`\u6307\u4ee4\uff0c\u4f8b\u5982`sudoaptupdate`\uff0c\u6267\u884c\u8f6f\u4ef6\u5305\u5217\u8868\u7684\u66f4\u65b0\u3002<\/p>\n

\u65e0\u5bc6\u7801sudo\u914d\u7f6e\uff1a\u5c3d\u7ba1\u4ece\u5b89\u5168\u89d2\u5ea6\u4e0d\u5efa\u8bae\uff0c\u4f46\u53ef\u901a\u8fc7\u7f16\u8f91`\/etc\/sudoers`\u6587\u4ef6\uff08\u5efa\u8bae\u7528`visudo`\u5de5\u5177\u4ee5\u9632\u8bed\u6cd5\u5931\u8bef\uff09\u8bbe\u7f6e\u7279\u5b9a\u7528\u6237\u6216\u7528\u6237\u7ec4\u80fd\u591f\u65e0\u9700\u5bc6\u7801\u76f4\u63a5\u6267\u884csudo\u64cd\u4f5c\u3002<\/p>\n

\u56db\u3001\u7ba1\u7406sudo\u6743\u9650<\/b><\/p>\n

ubuntu \u6253\u5f00root_\u6253\u5f00ubuntu\u9ed1\u5c4f\u5f88\u591a\u5b57\u7b26_\u6253\u5f00ubuntu\u84dd\u5c4f<\/p>\n

Ubuntu\u5229\u7528`\/etc\/sudoers`\u6587\u6863\u6267\u884csudo\u6743\u9650\u914d\u7f6e\u3002\u4ec5\u9650\u6388\u6743\u7528\u6237\uff08\u901a\u5e38\u4e3aroot\uff09\u53ef\u6267\u884c\u8be5\u6587\u4ef6\u7684\u7f16\u8f91\u3002\u4ee5`visudo`\u6307\u4ee4\u8fdb\u884c\u7f16\u8f91\u80fd\u591f\u6709\u6548\u9884\u9632\u8bed\u6cd5\u9519\u8bef\uff0c\u4e3a\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n

\u8d4b\u4e88sudo\u6743\u9650\uff1a\u5728Ubuntu\u4e2d\uff0c\u5c06\u7528\u6237\u52a0\u5165`sudo`\u7ec4\u662f\u6388\u4e88sudo\u8bbf\u95ee\u6743\u7684\u5e38\u89c4\u65b9\u6cd5\u3002\u901a\u8fc7\u6267\u884c`usermod-aGsudo\u7528\u6237\u540d`\u5373\u53ef\u5c06\u7528\u6237\u52a0\u5165sudo\u7ec4\u3002<\/p>\n

\u914d\u7f6esudo\u6743\u9650\uff1a\u901a\u8fc7\u4fee\u6539`\/etc\/sudoers`\u6587\u4ef6\uff0c\u53ef\u5b9e\u73b0\u9488\u5bf9\u4e2a\u522b\u7528\u6237\u6216\u7ec4\u7684sudo\u6743\u9650\u5b9a\u5236\uff0c\u5982\u8bbe\u5b9a\u6267\u884c\u7279\u5b9a\u547d\u4ee4\u6216\u4ec5\u9650\u7279\u5b9a\u65f6\u6bb5\u4f7f\u7528sudo\u3002<\/p>\n

\u4e94\u3001sudo\u7684\u65e5\u5fd7\u4e0e\u5ba1\u8ba1<\/b><\/p>\n

\u6253\u5f00ubuntu\u84dd\u5c4f_\u6253\u5f00ubuntu\u9ed1\u5c4f\u5f88\u591a\u5b57\u7b26_ubuntu \u6253\u5f00root<\/p>\n

sudo\u65e5\u5fd7\u5728\u7cfb\u7edf\u5b89\u5168\u7ba1\u7406\u4e0e\u5ba1\u8ba1\u4e2d\u626e\u6f14\u5173\u952e\u89d2\u8272\u3002\u5728Ubuntu\u7cfb\u7edf\u4e2dlinux\u6587\u672c\u7f16\u8f91\u5668\uff0csudo\u65e5\u5fd7\u901a\u5e38\u5b58\u4e8e`\/var\/log\/auth.log`\uff0c\u7136\u800c\uff0c\u5177\u4f53\u4f4d\u7f6e\u53ef\u80fd\u56e0\u7cfb\u7edf\u8bbe\u7f6e\u800c\u5f02\u3002\u53ef\u901a\u8fc7\u6267\u884c`grep`\u547d\u4ee4\u6216\u5bf9\u91c7\u7528systemd\u7684\u64cd\u4f5c\u7cfb\u7edf\u4f7f\u7528`journalctl`\u6765\u68c0\u7d22\u548c\u6d4f\u89c8sudo\u65e5\u5fd7\u3002<\/p>\n

\u516d\u3001\u5b89\u5168\u6700\u4f73\u5b9e\u8df5<\/b><\/p>\n

\u9075\u5faa\u6700\u5c0f\u6743\u9650\u89c4\u8303\uff0c\u4ec5\u63d0\u4f9b\u5b8c\u6210\u804c\u8d23\u5fc5\u8981\u6743\u9650\u3002<\/p>\n

\u6267\u884c\u5468\u671f\u6027sudo\u65e5\u5fd7\u5ba1\u8ba1\uff1a\u901a\u8fc7\u5468\u671f\u6027\u5ba1\u67e5sudo\u65e5\u5fd7\uff0c\u65e8\u5728\u63ed\u9732\u6f5c\u5728\u5f02\u5e38\u884c\u4e3a\u6216\u672a\u6388\u6743\u7684sudo\u64cd\u4f5c\u3002<\/p>\n

ubuntu \u6253\u5f00root_\u6253\u5f00ubuntu\u84dd\u5c4f_\u6253\u5f00ubuntu\u9ed1\u5c4f\u5f88\u591a\u5b57\u7b26<\/p>\n

-\u914d\u7f6e\u522b\u540d\u53ca\u6743\u9650\u9650\u5236\uff1a\u4e8e`\/etc\/sudoers`\u6587\u4ef6\u5185\u8bbe\u7acb\u547d\u4ee4\u522b\u540d\u5e76\u65bd\u52a0\u5408\u7406\u9650\u5236\uff0c\u65e8\u5728\u964d\u4f4e\u8bef\u64cd\u4f5c\u548c\u5b89\u5168\u5a01\u80c1\u3002<\/p>\n

\u4e03\u3001\u603b\u7ed3\u4e0e\u53cd\u601d<\/b><\/p>\n

\u5728Ubuntu\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0cRoot\u6743\u9650\u65e2\u662f\u6743\u529b\u4e4b\u6e90\u4e5f\u662f\u98ce\u9669\u4e4b\u6e90\u3002\u5b83\u8d4b\u4e88\u7528\u6237\u5168\u9762\u7ba1\u7406\u7cfb\u7edf\u7684\u80fd\u529b\uff0c\u5374\u4e5f\u53ef\u80fd\u589e\u52a0\u5b89\u5168\u6f0f\u6d1e\u3002\u901a\u8fc7\u59a5\u5584\u8fd0\u7528sudo\u547d\u4ee4\u4ee5\u53ca\u9075\u5faa\u5b89\u5168\u51c6\u5219\uff0c\u6211\u4eec\u53ef\u5728\u5145\u5206\u5229\u7528Ubuntu\u4fbf\u5229\u6027\u7684\u540c\u65f6\uff0c\u4fdd\u969c\u7cfb\u7edf\u5b89\u5168\u548c\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n

\u6700\u540e\u7684\u95ee\u9898\uff1a<\/b><\/p>\n

\u5728Ubuntu\u4f7f\u7528\u4e2d\uff0c\u60a8\u5982\u4f55\u7ba1\u7406Root\u6743\u9650\uff1f\u662f\u5426\u906d\u9047\u8fc7\u9700\u7279\u522b\u89e3\u51b3\u7684\u573a\u666f\uff1f\u656c\u8bf7\u4e8e\u8bc4\u8bba\u533a\u5206\u4eab\u60a8\u7684\u7ecf\u9a8c\u4e0e\u89c2\u70b9\uff0c\u5171\u4fc3\u5b66\u4e60\u4e0e\u8fdb\u6b65\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5c3d\u7ba1\u5982\u6b64\uff0cUbuntu\u51fa\u4e8e\u5b89\u5168\u76ee\u7684\uff0c\u672a\u9ed8\u8ba4\u542f\u7528Root\u8d26\u6237\u767b\u5f55\uff0c\u800c\u662f\u501f\u52a9sudo\u6765\u63a7\u5236\u6743\u9650\u3002\u5c3d\u7ba1\u4e0d\u5efa\u8bae\uff0c\u4f46\u5728\u7279\u5b9a\u5e94\u7528\u6216\u811a\u672c\u9700\u4ee5Root\u7528\u6237\u6267\u884c\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u6fc0\u6d3bRoot\u8d26\u6237\uff1a\u5728\u5e38\u89c4\u64cd\u4f5c\u4e2d\uff0csudo\u662f\u63a8\u8350\u7528\u4e8e\u8fd0\u884c\u9700Root\u6743\u9650\u7684\u6307\u4ee4\u3002<\/p>\n","protected":false},"author":1,"featured_media":293557,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[3505,3506,2751,3508,3507],"class_list":["post-293556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-rzh","tag-szl","tag-aqpz","tag-glqx","tag-rjbgx"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293556","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=293556"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293556\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/293557"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=293556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=293556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=293556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}