{"id":8564,"date":"2024-06-04T14:01:01","date_gmt":"2024-06-04T06:01:01","guid":{"rendered":""},"modified":"2024-06-04T14:01:01","modified_gmt":"2024-06-04T06:01:01","slug":"linux\u4fee\u6539\u81ea\u5df1\u7684\u8d26\u6237\u540d\u5b57\u548c\u8bbe\u5907\u540d\u5b57_\u600e\u4e48\u4fee\u6539\u8bbe\u5907\u540d\u79f0","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8564.html","title":{"rendered":"linux\u4fee\u6539\u81ea\u5df1\u7684\u8d26\u6237\u540d\u5b57\u548c\u8bbe\u5907\u540d\u5b57_\u600e\u4e48\u4fee\u6539\u8bbe\u5907\u540d\u79f0"},"content":{"rendered":"
1.\u4fee\u6539\u8d26\u6237\u540d\u5b57xxx\u4e3aaaa:<\/strong><\/span><\/p>\n 1.1\u5207\u6362\u5230\u8d85\u7ea7\u7528\u6237<\/span><\/p>\n 1.2\u4fee\u6539\/etc\/passwd\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u7684\u7528\u6237\u540d\u90e8\u5206\u3001\u7528\u6237\u7ec4\u90e8\u5206\u548c\u4e3b\u76ee\u5f55\u90e8\u5206<\/span><\/p>\n 1.3\u4fee\u6539\/etc\/group\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u7684\u7ec4\u540d\u90e8\u5206\uff08\u7ec4\u6807\u8bc6\u53f7\u4e0d\u53d8\uff09\uff0c\u540c\u65f6\u4e5f\u5c06\/etc\/gshadow\u6539\u5199\u4e00\u4e0b<\/span><\/p>\n 1.4\u4fee\u6539\/etc\/shadow\u6587\u4ef6\u4e2d\u7684\u7528\u6237\u540d\u90e8\u5206<\/span><\/p>\n 1.5\u4fee\u6539\/home\/olduser\u4e3a\/home\/newuser\uff0c\u540c\u65f6\u6ce8\u610f\u4e00\u5b9a\u8981\u4fee\u6539\u5176\u6240\u5c5e\u7684\u7528\u6237\u548c\u7528\u6237\u7ec4\uff0c\u8fd9\u4e2a\u5f88\u5173\u952e<\/span><\/p>\n 1.6\u4fee\u6539sudoers\u6587\u4ef6<\/span><\/p>\n <\/em><\/strong><\/strong><\/span>\u7ecf\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u4e00\u822c\u4eba\u90fd\u8ba4\u4e3a\u5927\u529f\u544a\u6210\u4e86\uff0c\u800c\u7f51\u4e0a\u8d44\u6599\u4e5f\u6700\u591a\u53ea\u6709\u4e0a\u9762\u51e0\u4e2a\u6b65\u9aa4\uff0c\u5176\u5b9e\u8fd8\u6709\u4e00\u70b9\u5f88\u91cd\u8981\uff0c\u4ee5\u540e\u4f60\u5728\u4f7f\u7528sudo\u65f6\u4f1a\u63d0\u793a\"xxx is not in the sudoers file. This incident will be reported.\u5176\u4e2dxxx\u662f\u4f60\u7684\u7528\u6237\u540d\uff0c\u4e5f\u5c31\u662f\u4f60\u7684\u7528\u6237\u540d\u6ca1\u6709\u6743\u9650\u4f7f\u7528sudo\uff0c\u8fd9\u4e3b\u8981\u662f\u56e0\u4e3asudoers\u6587\u4ef6\u91cc\u8bb0\u5f55\u7684\u8fd8\u662f\u539f\u6765\u7684\u7528\u6237\u540d\uff0c\u9700\u8981\u66f4\u65b0\u8fc7\u6765\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/span><\/em><\/strong><\/strong><\/span><\/p>\n \uff081\uff09\u8fdb\u5165\u8d85\u7ea7\u7528\u6237\u6a21\u5f0f\u3002\u4e5f\u5c31\u662f\u8f93\u5165\"su -\"<\/span> \uff082\uff09\u6dfb\u52a0\u6587\u4ef6\u7684\u5199\u6743\u9650\u3002<\/span><\/p>\n \uff083\uff09\u7f16\u8f91\/etc\/sudoers\u6587\u4ef6\u3002<\/span><\/p>\n<\/p>\n \u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f\uff0c\u627e\u5230\u8fd9\u4e00 \u884c\uff1a \uff084\uff09\u64a4\u9500\u6587\u4ef6\u7684\u5199\u6743\u9650\u3002<\/span><\/p>\n 2.\u4fee\u6539\u8ba1\u7b97\u673a\u540d\u79f0xxx\u4e3aaaa\uff1a<\/strong><\/span><\/p>\n \u4fee\u6539\u6709\u4e24\u6b65\uff1a<\/span><\/p>\n ]\u4fee\u6539\/etc\/hosts\uff1asudo vim \/etc\/hosts<\/span><\/p>\n [2]\u4fee\u6539\/etc\/hostname\u5185\u5bb9\u4e3a aaa \u4fdd\u5b58\uff0c\u9000\u51fa\uff0c\u91cd\u542f\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002 <\/span> <\/p>\n","protected":false},"excerpt":{"rendered":"linux\u4fee\u6539\u81ea\u5df1\u7684\u8d26\u6237\u540d\u5b57\u548c\u8bbe\u5907\u540d\u5b57_\u600e\u4e48\u4fee\u6539\u8bbe\u5907\u540d\u79f01.\u4fee\u6539\u8d26\u6237\u540d\u5b57xxx\u4e3aaaa:1.1\u5207\u6362\u5230\u8d85\u7ea7\u7528\u62371.2\u4fee\u6539\/etc\/passwd\u8fd9\u4e2a\u6587\u4ef6...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8564"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8564"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8564\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\u6ce8\u610f\u8fd9\u91cc\u6709\"-\" \uff0c\u8fd9\u548csu\u662f\u4e0d\u540c\u7684\uff0c\u5728\u7528\u547d\u4ee4\u201dsu\u201d\u7684\u65f6\u5019\u53ea\u662f\u5207\u6362\u5230root\uff0c\u4f46\u6ca1\u6709\u628aroot\u7684\u73af\u5883\u53d8\u91cf\u4f20\u8fc7\u53bb\uff0c\u8fd8\u662f\u5f53\u524d\u7528\u6237\u7684\u73af\u5883\u53d8\u91cf\uff0c\u7528\u201dsu -\u201d\u547d\u4ee4\u5c06\u73af\u5883\u53d8\u91cf\u4e5f\u4e00\u8d77\u5e26\u8fc7\u53bb\uff0c\u5c31\u8c61\u548croot\u767b\u5f55\u4e00\u6837\u3002<\/span><\/p>\n
root ALL=(ALL) ALL
\u5728\u5b83\u7684\u4e0b\u9762\u6dfb\u52a0:
hadoop ALL=(ALL) ALL
\u8fd9\u91cc\u7684hadoop\u662f\u4f60\u7684\u65b0\u7528\u6237\u540d\uff0c\u7136\u540e\u4fdd\u5b58\u9000\u51fa\u3002<\/span><\/p>\n