{"id":137505,"date":"2020-07-13T02:28:57","date_gmt":"2020-07-12T18:28:57","guid":{"rendered":"http:\/\/4563.org\/?p=137505"},"modified":"2020-07-13T02:28:57","modified_gmt":"2020-07-12T18:28:57","slug":"%e8%b6%8a%e6%90%9e%e8%b6%8a%e5%bf%83%e7%83%a6%ef%bc%8c%e5%85%b3%e4%ba%8e-linux-%e7%b3%bb%e7%bb%9f%e4%b8%8b-root-%e5%92%8c%e6%99%ae%e9%80%9a%e7%94%a8%e6%88%b7%e7%9a%84%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=137505","title":{"rendered":"\u8d8a\u641e\u8d8a\u5fc3\u70e6\uff0c\u5173\u4e8e Linux \u7cfb\u7edf\u4e0b root \u548c\u666e\u901a\u7528\u6237\u7684\u7ba1\u7406"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8d8a\u641e\u8d8a\u5fc3\u70e6\uff0c\u5173\u4e8e Linux \u7cfb\u7edf\u4e0b root \u548c\u666e\u901a\u7528\u6237\u7684\u7ba1\u7406               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u963f\u91cc\u4e91\u7684 ecs\uff0cCentOS 8 \u3002<\/p>\n<p>\u6309\u7167\u7f51\u4e0a\u7684\u65b9\u6cd5\u6dfb\u52a0\u4e86\u666e\u901a\u7528\u6237\u3002<\/p>\n<p>\u5c31\u662f add user\uff0c\u7136\u540e passwd user\uff0c\u7136\u540e\u5728 sudoer \uff08\u8bb0\u4e0d\u592a\u6e05\uff09\u91cc\u6dfb\u52a0\u4e00\u884c username ALL \u90a3\u4e00\u53e5\u3002<\/p>\n<p>\u7136\u540e\u5c31\u662f\u5404\u79cd permission denied\uff0cls \u4e5f\u662f denied \u3002<\/p>\n<p>\u60f3\u6765\u95ee\u4e00\u4e0b\u5173\u4e8e\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u7a76\u7adf\u5982\u4f55\u6b63\u786e\u7684\u6dfb\u52a0\u4e00\u4e2a\u666e\u901a\u7528\u6237\uff1f<\/p>\n<p>\u7f51\u4e0a\u7684\u65b9\u6cd5\u5927\u81f4\u90fd\u662f\u76f8\u540c\u7684\uff0c\u54ce\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>17<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2584956\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PbCopy111 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`<br \/>adduser XanderChen <br \/>sudo vi \/etc\/sudoers <br \/>\u6dfb\u52a0\u5982\u4e0b\u4fe1\u606f\u5230 root \u90a3\u884c\u4e0b\u9762<br \/>XanderChen ALL=(ALL:ALL) ALL <br \/>&#8220;`<\/p>\n<p>\u6309!wq \u4fdd\u5b58\u9000\u51fa\u3002\u91cd\u65b0\u767b\u5f55\u3002\u3002\u3002<\/p>\n<p>\u8bf7\u95ee\uff0c\u4f60\u662f\u6309\u7167\u6b65\u9aa4\u4e00\u6b65\u4e00\u6b65\u7684\u505a\u7684\u4e48\uff1f\u4f60\u770b\u7684\u4ec0\u4e48\u6559\u6750\uff1f\uff1f\u9e1f\u54e5\uff1f\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584957\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @PbCopy111 <\/p>\n<p>\u4e0d\u662f\u5565\u6559\u6750\u554a\uff0c\u6211\u5c31\u5728\u7f51\u4e0a\u641c\u7684 linux \u600e\u4e48\u6dfb\u52a0\u7528\u6237&#8230;<\/p>\n<p>\u4f60\u5199\u7684\u90a3\u4e00\u53e5 XanderChen ALL=(ALL:ALL) ALL \u6bd4\u6211\u770b\u7684\u591a\u4e86\u62ec\u53f7\u91cc\u5192\u53f7 ALL \u90a3\u4e00\u90e8\u5206\uff0c<\/p>\n<p>\u5982\u679c\u53ea\u5199 XanderChen ALL=(ALL) ALL \u6709\u4ec0\u4e48\u533a\u522b\u5417                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584958\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abbottcn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u5c31\u662f\u6dfb\u52a0\u4e2a\u666e\u901a\u7528\u6237\u5417\uff0c\u548c sudoer \u6709\u4ec0\u4e48\u5173\u7cfb\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584959\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @abbottcn \u6211\u4e5f\u4e0d\u77e5\u9053\u554a\uff0c\u6211\u641c\u7684 linux \u7cfb\u7edf\u4e0b\u589e\u52a0\u7528\u6237\uff0c\u51fa\u6765\u7684\u6587\u7ae0\u5168\u662f\u6211\u4e00\u5199\u7684\u90a3\u4e9b\u64cd\u4f5c\u8fc7\u7a0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584960\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u822c\u6765\u8bf4\u4e60\u60ef\u4e8e\u628a\u65b0\u5efa\u7684\u7528\u6237\u52a0\u5230\u4e00\u4e2a\u7279\u6743\u7ec4\uff08\u6bd4\u5982 wheel \uff09\uff0c\u7136\u540e visudo \u7ed9 wheel \u7ec4\u6388\u4e88\u7279\u6743\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584961\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abbottcn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @XanderChen \u5efa\u8bae\uff0c\u5c11\u770b\u90a3\u4e9b\u4e2a\u8d44\u6599\uff0c\u770b man useradd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584962\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @abbottcn \u597d\u7684\uff0c\u6211\u53bb\u770b\u770b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584963\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tolerance <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728 \/etc\/sudoers.d\/\u76ee\u5f55\u4e0b\u6dfb\u52a0\u6587\u4ef6\uff0c\u6bd4\u6539 sudoers \u6587\u4ef6\u597d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584964\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ciaoly <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             man sudo<br \/>\u5efa\u8bae\u7528\u7528 FreeBSD\uff0c\u7528\u7740\u7528\u7740\u5c31\u517b\u6210\u67e5\u6587\u6863\u7684\u4e60\u60ef\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584965\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PbCopy111 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @XanderChen #2 \u6dfb\u52a0\u7528\u6237\u4e86\uff0c\u4f46\u4f60\u6ca1\u6709 root \u7684\u6743\u9650\uff0c\u4ec0\u4e48\u90fd\u505a\u4e0d\u4e86\uff0c\u7b2c\u4e8c\u6b65\u662f\u7ed9\u4f60 sudo \u7684\u6743\u9650\u3002<br \/>\u4f60\u4e0d\u7528\u95ee\u4e3a\u4ec0\u4e48\uff0c\u7167\u7740\u505a\u5c31\u53ef\u4ee5\u4e86\u3002<br \/>\u8fd8\u6709\uff0c\u770b\u9e1f\u54e5\u7684 linux \u79c1\u623f\u83dc\uff0c\u7167\u7740\u505a\uff0c\u4ed6\u90a3\u4e2a\u53ef\u80fd\u8fc7\u65f6\u4e86\uff0c\u4f46\u9519\u8bef\u5c11\u3002\u3002\u3002\u522b\u95ee\u4e3a\u4ec0\u4e48\uff0c\u8bf4\u4e86\u4f60\u4e5f\u4e0d\u61c2\uff0c\u5148\u7167\u7740\u505a\uff0c\u505a\u8d77\u6765\u4e86\uff0c\u597d\u73a9\u4e86\u5c31\u53ef\u4ee5\u7ee7\u7eed\u4e86\u3002\u3002\u3002\u6211\u521a\u5f00\u59cb\u5b66\u4e86\u597d\u51e0\u5e74 linux\uff0c\u5c31\u662f\u56e0\u4e3a\u6ca1\u5174\u8da3\u4e86\u653e\u5f03\u4e86\u3002\u3002\u3002\u539f\u56e0\u4e5f\u662f\u770b\u4e0d\u61c2\u3002<br \/>\u6240\u4ee5\u522b\u95ee\uff0c\u7167\u7740\u4e00\u6478\u4e00\u6837\u7684\u53bb\u505a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584966\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @PbCopy111 \u54c8\u54c8\uff0c\u597d\uff0c\u6211\u77e5\u9053\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584967\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nguoidiqua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u628a\u91cc\u9762\u90a3\u4e2a root \u4e00\u884c\u6284\u4e00\u904d\u5c31\u884c\u4e86\uff0croot \u6539\u6210\u4f60\u81ea\u5df1\u7684\u7528\u6237\u540d\u5c31\u884c\u4e86\u3002<\/p>\n<p>\u7f51\u4e0a\u90a3\u4e9b\u4e1c\u897f\u9760\u4e0d\u4f4f\u7684\uff0c\u5f97\u81ea\u5df1\u67e5\u624b\u518c\u987a\u4fbf\u4e86\u89e3\u4e0b\u539f\u7406\u3002<\/p>\n<p>\u90a3\u4e2a\u6587\u4ef6\u91cc\u9762\u4e00\u822c\u8fd8\u4f1a\u6709 %sudo \u6216\u8005 %wheel \u4ec0\u4e48\u7684\uff0c\u4f60\u7528 usermod \u628a\u7528\u6237\u52a0\u5165 sudo wheel \u7ec4\u4ec0\u4e48\u4e5f\u53ef\u4ee5\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584968\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nguoidiqua \u597d\u7684\uff0c\u6211\u518d\u7814\u7a76\u7814\u7a76\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584969\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Tink <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u628a\u7528\u6237\u52a0\u5230 wheel \u91cc\u4e0d\u5c31\u884c\u4e86\u5417\uff0c\u8ddf sudo \u6ca1\u5173\u7cfb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584970\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : raaaaaar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u5b66\u8d26\u6237\u7ba1\u7406\u7684\u77e5\u8bc6\u3002\u5373\u7528\u6237\u548c\u7528\u6237\u7ec4\uff0c\u518d\u5b66\u6587\u4ef6\u6743\u9650\u7684\u77e5\u8bc6\uff0c\u4e0d\u7528\u6df1\u5165\u5b66\u8bed\u6cd5\uff0c\u77e5\u9053\u90a3\u4e2a\u547d\u4ee4\u7a76\u7adf\u5728\u505a\u4e9b\u4ec0\u4e48\u5c31\u884c\uff0c\u7136\u540e\u8981\u7528\u65f6\u5b85\u67e5\u547d\u4ee4\u5373\u53ef\uff0c\u4e0d\u7136\u4f60\u90fd\u4e0d\u77e5\u9053\u81ea\u5df1\u5728\u505a\u4e9b\u4ec0\u4e48                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584971\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : julyclyde <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e8b\u548c\u4e91\u6ca1\u5173\u7cfb\uff0c\u751a\u81f3\u548c linux \u6ca1\u5565\u5173\u7cfb<br \/>\u5173\u952e\u95ee\u9898\u5728\u4e8e\u4f60\uff0c\u4f60\u81ea\u5df1\u7684\u5b66\u4e60\u65b9\u6cd5\u6709\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2584972\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : XanderChen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @julyclyde \u6709\u6211\u5565\u4e8b\u513f\uff0c\u6211\u5b66\u4e2a der \u4e86\u6211\u5b66\uff0c\u6211\u4ec0\u4e48\u90fd\u6ca1\u5b66\u554a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8d8a\u641e\u8d8a\u5fc3\u70e6\uff0c\u5173\u4e8e Linux \u7cfb\u7edf&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/137505"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137505"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/137505\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137505"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}