{"id":398,"date":"2011-02-04T02:50:00","date_gmt":"2011-02-03T18:50:00","guid":{"rendered":"http:\/\/www.prayerlaputa.com\/?p=398"},"modified":"2011-02-04T02:50:00","modified_gmt":"2011-02-03T18:50:00","slug":"xx-is-not-in-the-sudoers-file-%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3%e3%80%90%e8%bd%ac%e8%bd%bd%e3%80%91-2","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=398","title":{"rendered":"xx is not in the sudoers file \u95ee\u9898\u89e3\u51b3\u3010\u8f6c\u8f7d\u3011"},"content":{"rendered":"<p><wbr \/>\u539f\u5e16\u5730\u5740\uff1ahttp:\/\/blog.sina.com.cn\/s\/blog_4ef045ab0100j59t.html<br \/>\n<wbr \/><br \/>\n&nbsp;<br \/>\n\u6211\u7528\u7684\u662fredhat5.4\uff0c\u5728\u4e00\u822c\u7528\u6237\u4e0b\u6267\u884csudo\u547d\u4ee4\u63d0\u793allhtiger is not in the sudoers file. This incident will be reported.\u89e3\u51b3\u65b9\u6cd5\uff1a<br \/>\n\u4e00\u3001$whereis sudoers \uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\u627e\u51fa\u6587\u4ef6\u6240\u5728\u7684\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u90fd\u662f\/etc\/sudoers\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/><br \/>\n\u4e8c\u3001 #chmod u+w \/etc\/sudoers\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/> \u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55su -root \uff0c\u4fee\u6539\u6587\u4ef6\u6743\u9650\u5373\u6dfb\u52a0\u6587\u4ef6\u62e5\u6709\u8fd9\u7684\u5199\u6743\u9650 \u9650\uff0cls -al \/etc\/sudoers \u53ef\u4ee5\u67e5\u770b\u539f\u6587\u4ef6\u7684\u6743\u9650\u3002\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/><br \/>\n\u4e09\u3001vim \/etc\/sudoers \u7f16\u8f91\u6587\u4ef6\uff0c\u5728root ALL=(ALL)ALL\u884c\u4e0b\u6dfb\u52a0XXX ALL=(ALL)ALL\uff0cXXX\u4e3a\u4f60\u7684\u7528\u6237\u540d\u3002\u6dfb\u52a0\u65b9\u6cd5\uff1a\u627e\u5230root\u884c\uff0c\u6309\u4e0b\u201di\u201c\u952e\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f\u6dfb\u52a0\u5373\u53ef\uff01\u7f16\u8f91\u597d\u540eesc\u952e\u8fdb\u5165\u4e00\u822c\u6a21\u5f0f\uff0c\u201c\uff1awq&#8221;\u4fdd\u5b58\u9000\u51fa\uff01<br \/>\n\u6700\u540e\uff0c #chmod u\uff0dw \/etc\/sudoers \u56de\u5230\u6587\u4ef6\u7684\u539f\u6743\u9650\uff01<br \/>\n<!--more--><wbr \/><br \/>\n<wbr \/><br \/>\n\u4e0b\u9762\u8fd9\u4e2a\u7a0d\u5fae\u8be6\u7ec6\u4e00\u70b9\uff1a<br \/>\n<span style=\"widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px;\"><span style=\"text-align: left; line-height: 21px; font-family: simsun,\u5b8b\u4f53,sans-serif; color: #464646; font-size: 14px;\">\u5728ubuntu\u4e2d\u7531\u4e8e\u7981\u7528\u4e86root\u7528\u6237\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u628a\u5b89\u88c5\u7cfb\u7edf\u65f6\u5efa\u7acb\u7684\u7528\u6237\u6dfb\u52a0\u5230sudoers\u4e2d\u3002\u4f46\u5728redhat\u548ccentos\u4e2d\u5e76\u6ca1\u6709\u628a\u4efb\u4f55root\u7528\u6237\u4e4b\u5916\u7684\u7528\u6237\u9ed8\u8ba4\u7684\u6dfb\u52a0\u5230sudoers\u4e4b\u4e2d\u3002\u8fd9\u6837\u6211\u4eec\u5728\u6267\u884csudo \u547d\u4ee4\u65f6\u5c31\u4f1a\u51fa\u73b0xxx is not in the sudoers file. This incident will be reported.\u8fd9\u6837\u7684\u9519\u8bef\u8f93\u51fa\u3002\u73b0\u5728\u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\u6bd4\u8f83\u63d0\u5021\u4f7f\u7528\u666e\u901a\u7528\u6237\u505a\u65e5\u5e38\u64cd\u4f5c\uff0c\u800c\u5728\u9700\u8981\u8d85\u7ea7\u7528\u6237\u7684\u65f6\u5019\u4f7f\u7528sudo \u6765\u505a\uff0c\u8fd9\u6837\uff0c\u6211\u4eec\u5c31\u6709\u5fc5\u8981\u628a\u4e00\u4e9b\u7528\u6237\u6dfb\u52a0\u5230sudoers\u4e4b\u4e2d\u3002<br \/>\n\u5176\u5b9e\u628a\u7528\u6237\u6dfb\u52a0\u5230sudoers\u4e4b\u4e2d\u5f88\u7b80\u5355\u3002<br \/>\n\u9996\u5148\u5229\u7528whereis \u547d\u4ee4\u67e5\u627esudoers\u914d\u7f6e\u6587\u4ef6\u7684\u76ee\u5f55\uff08\u9ed8\u8ba4\u4f1a\u5728\/etc\/sudoers)<br \/>\n[root@localhost xiaofei]# whereis sudoers<br \/>\nsudoers: \/etc\/sudoers \/etc\/sudoers.bak \/usr\/share\/man\/man5\/sudoers.5.gz<br \/>\n\u7136\u540e\u9700\u8981\u5207\u6362\u5230root\u7528\u6237\uff0c\u66f4\u6539\/etc\/sudoers\u7684\u6743\u9650<br \/>\n[root@localhost xiaofei]# chmod u+w \/etc\/sudoers<br \/>\n\u7136\u540e\u5c31\u53ef\u4ee5\u5229\u7528vi\u7f16\u8f91\u5668\u6765\u628a\u7528\u6237\u6dfb\u52a0\u5230sudoers\u4e4b\u4e2d<br \/>\n[root@localhost xiaofei]# vi \/etc\/sudoers<br \/>\n\u7136\u540e\u627e\u5230root\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>ALL=(ALL)\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>ALL\u6240\u5728\u7684\u4f4d\u7f6e\uff0c\u628a\u6240\u8981\u6dfb\u52a0\u7684\u7528\u6237\u6dfb\u52a0\u5230\u6587\u4ef6\u4e4b\u4e2d\uff0c<br \/>\n\u987a\u4fbf\u63d0\u4e00\u4e0bvi\u7f16\u8f91\u5668\u7684\u7528\u6cd5\u3002\u521a\u8fdb\u5165vi\u7f16\u8f91\u5668\u7684\u65f6\u5019\u724c\u547d\u4ee4\u884c\u6a21\u5f0f\uff0c\u8fd9\u65f6\u53ef\u4ee5\u901a\u8fc7\u65b9\u5411\u952e\u6765\u79fb\u52a8\u5149\u6807\uff0c\u627e\u5230\u8981\u7f16\u8f91\u7684\u4f4d\u7f6e\u4e4b\u540e\u6309\u4e0b\u201ci\u201d\uff0c\u7136\u540e\u5c31\u8fdb\u5165\u4e86\u63d2\u5165\u6a21 \u5f0f\uff0c\u8fd9\u65f6\u5019\u4f60\u53ef\u4ee5\u8f93\u5165\u6216\u5220\u9664\u5b57\u7b26\u3002\u7f16\u8f91\u5b8c\u6210\u4e4b\u540e\u6309\u201cesc\u201d\u952e\u9000\u51fa\u63d2\u5165\u6a21\u5f0f\uff0c\u8fdb\u5165\u547d\u4ee4\u884c\u6a21\u5f0f\uff0c\u8fd9\u65f6\u5019\u6309\u201c\uff1a\u201d\u53ef\u4ee5\u8fdb\u5165\u672b\u884c\u6a21\u5f0f\uff0c\u8f93\u5165\u201cwq\u201d\u4fdd\u5b58\u5e76\u9000\u51fa\u3002<br \/>\n\u4e0b\u9762\u662f\u6dfb\u52a0\u5b8c\u7684\u7ed3\u679c\u3002<br \/>\n## Allow root to run any commands anywhere<br \/>\nroot\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>ALL=(ALL)\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>ALL<br \/>\nxiaofei ALL=(ALL)\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>ALL\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/><wbr \/>\u00a0<wbr \/>\uff08\u8fd9\u4e00\u884c\u662f\u6dfb\u52a0\u7684\u5185\u5bb9\uff0cxiaofei\u662f\u6211\u7684\u7528\u6237\u540d\uff09<br \/>\n\u7136\u540e\u9700\u8981\u628asudoers \u7684\u5199\u6743\u9650\u53bb\u6389\uff08\u5426\u5219\u7cfb\u7edf\u4e0d\u5141\u8bb8\u6267\u884csuoders\u6587\u4ef6\uff09\uff1a<br \/>\n[root@localhost xiaofei]# chmod u-w \/etc\/sudoers<br \/>\n\u81f3\u6b64\uff0c\u5728\u9000\u51faroot\u7528\u6237\u4e4b\u540e\u5c31\u53ef\u4ee5\u5229\u7528sudo\u547d\u4ee4\u6765\u6267\u884c\u8d85\u7ea7\u7528\u6237\u7684\u6743\u9650\u4e86\u3002<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u5e16\u5730\u5740\uff1ahttp:\/\/blog.sina.com.cn\/s\/blog_4ef045ab0100j59t.ht <a href='http:\/\/prayerlaputa.com\/?p=398' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[7],"tags":[34],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/398"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":0,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}