{"id":294948,"date":"2024-12-13T12:17:23","date_gmt":"2024-12-13T04:17:23","guid":{"rendered":"https:\/\/lrxjmw.cn\/rhzlzsycmlwi.html"},"modified":"2024-12-13T12:17:23","modified_gmt":"2024-12-13T04:17:23","slug":"rhzlzsycmlwi","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rhzlzsycmlwi.html","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528chmod\u547d\u4ee4\u4e3aifconfig\u6dfb\u52a0setuid\u6743\u9650\u5e76\u4fee\u6539\u5bc6\u7801"},"content":{"rendered":"

linux\u66f4\u6539\u547d\u4ee4<\/a>\uff1f<\/p>\n

chmod<\/p>\n

u+s<\/p>\n

ifconfig<\/p>\n

\u7ed9\u547d\u4ee4\u6dfb\u52a0\u4e00\u4e2asetuid\u6743\u9650\u5c31\u53ef\u4ee5\uff0c\u8fd9\u6837\u6267\u884c\u547d\u4ee4\u65f6\uff0c\u666e\u901a\u7528\u6237\u5c31\u6210\u4e86root\u3002<\/p>\n

\u5728linux\u4e2d\uff0c\u4e0d\u7ba1\u662froot\u7528\u6237\u8fd8\u662f\u666e\u901a\u7528\u6237\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528\u201cpassword\u201d\u547d\u4ee4\u6765\u4fee\u6539\u81ea\u8eab\u7684\u5bc6\u7801\u3002\u5e76\u4e14\uff0clinux\u4e2d\u7684\u5bc6\u7801\u4e00\u822c\u662f\u4fdd\u5b58\u5728\u201c\/etc\/paswd\u201d\u548c\u201c\/etc\/shadow\u201d\u6587\u4ef6\u4e2d\uff0c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5bf9\u7cfb\u7edf\u5b89\u5168\u81f3\u5173\u91cd\u8981\uff0c\u56e0\u800c\u53ea\u6709root\u7528\u6237\u80fd\u591f\u5bf9\u5176\u6267\u884c\u8bfb\u5199\u64cd\u4f5c\u3002\u4ee5\u7ba1\u7406\u5458\u7684\u8eab\u5206\u767b\u5165\u7cfb\u7edf\uff0c\u5728linxu\u63d0\u793a\u7b26\u4e0b\u6267\u884c\u201cls<\/p>\n

\/etc\/passwd<\/p>\n

\/etc\/shadow\u201d\u547d\u4ee4\uff0c\u5728\u8fd4\u56de\u4fe1\u606f\u4e2d\u53ef\u4ee5\u770b\u89c1\u666e\u901a\u7528\u6237\u5bf9\u4e0a\u8ff0\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5e76\u6ca1\u6709\u5199\u6743\u9650\uff0c\u56e0\u800c\u4ece\u6587\u4ef6\u5c5e\u6027\u7684\u89d2\u5ea6\u770b\uff0c\u666e\u901a\u7528\u6237\u5728\u4fee\u6539\u81ea\u8eab\u5bc6\u7801\u65f6\uff0c\u662f\u96be\u4ee5\u5c06\u5bc6\u7801\u4fe1\u606f\u5199\u5165\u5230\u4e0a\u8ff0\u6587\u4ef6\u4e2d\u7684\uff0c\u54ea\u4e48\u7528\u6237\u662f\u5982\u4f55\u6210\u529f\u7684\u4fee\u6539\u5bc6\u7801\u7684\u5462\uff1f\u5b9e\u9645\u4e0a\uff0c\u95ee\u9898\u7684\u5173\u952e\u4e0d\u5728\u4e8e\u5bc6\u7801\u6587\u4ef6\u672c\u8eab\uff0c\u800c\u5728\u4e8e\u5bc6\u7801\u4fee\u6539\u547d\u4ee4\u201cpasswd\u201d\u3002\u5728\u63d0\u793a\u7b26\u4e0b\u6267\u884c\u547d\u4ee4\u201cls<\/p>\n

\/usr\/bin\/passwd\u201d,\u5728\u8fd4\u56de\u4fe1\u606f\u4e2d\u7684\u6587\u4ef6\u6240\u6709\u8005\u6267\u884c\u6743\u9650\u4f4d\u4e0a\u663e\u793a\u201cs\u201d\u5b57\u6837\uff0c\u8868\u793a\u201cpasswd\u201d\u547d\u4ee4\u5177\u6709setuid\u6743\u9650\uff0c\u5176\u6240\u6709\u8005\u4e3aroot\uff0c\u8fd9\u6837\u666e\u901a\u7528\u6237\u5728\u6267\u884c\u201cpasswd\u201d\u547d\u4ee4\u65f6\uff0c\u5b9e\u9645\u4e0a\u4ee5\u6709\u6548\u7528\u6237root\u7684\u8eab\u5206\u6765\u6267\u884c\u7684\uff0c\u5e76\u5177\u6709\u4e86\u76f8\u5e94\u7684\u6743\u9650\uff0c\u56e0\u800c\u5c06\u65b0\u7684\u5bc6\u7801\u5199\u5165\u5230\u201c\/etc\/passwd\u201d\u548c\u201c\/etc\/shadow\u201d\u6587\u4ef6\u4e2d\uff0c\u5f53\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\uff0c\u8be5\u7528\u6237\u7684\u8eab\u5206\u7acb\u523b\u6d88\u5931\u3002\u600e\u4e48\u8bbe\u7f6esetuid\u6743\u9650\u5462\uff1f\u4f7f\u7528\u201cchmod\u201d\u547d\u4ee4\u5373\u53ef\u4e3a\u6307\u5b9a\u6587\u4ef6\u8bbe\u7f6esetuid\u6743\u9650\uff0c\u6bd4\u5982\u201cchmod<\/p>\n

4xxx<\/p>\n

filename\u201d\u547d\u4ee4linux\u7cfb\u7edf\u65e5\u5fd7\uff0c\u53d6\u6d88setuid\u6743\u9650\u7684\u547d\u4ee4\u4e3a\u201cchmod<\/p>\n

xxx<\/p>\n

\u547d\u4ee4\u542f\u52a8jar\u5305_linux\u542f\u52a8nginx\u547d\u4ee4_\u547d\u4ee4\u542f\u52a8\u9879<\/p>\n

filename\u201d\u3002\u7c7b\u4f3c\u7684\uff0c\u6267\u884c\u201cchmod<\/p>\n

2xxx<\/p>\n

filename\u201d\u547d\u4ee4\u53ef\u4ee5\u8bbe\u7f6esetuid\u6743\u9650\uff0c\u4f7f\u7528\u201cchmod<\/p>\n

xxx<\/p>\n

filename\u201d\u547d\u4ee4\u5373\u53ef\u53d6\u6d88setgid\u6743\u9650\uff0c\u5018\u82e5\u6267\u884c\u201cchmod<\/p>\n

6xxx<\/p>\n

filename\u201d\u547d\u4ee4\uff0c\u5373\u53ef\u540c\u65f6\u4e3a\u6307\u5b9a\u6587\u4ef6\u8bbe\u7f6esetuid\u548csetgid\uff0c\u6267\u884c\u547d\u4ee4\u201cchmod<\/p>\n

0xxx<\/p>\n

filename\u201d\uff0c\u5373\u53ef\u540c\u65f6\u53d6\u6d88\u6307\u5b9a\u6587\u4ef6\u7684setuid\u548csetgid\u6743\u9650\u3002\u8bf8\u5982\u4ee5root\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u6267\u884c\u201cchmod<\/p>\n

0511<\/p>\n

\u547d\u4ee4\u542f\u52a8jar\u5305_linux\u542f\u52a8nginx\u547d\u4ee4_\u547d\u4ee4\u542f\u52a8\u9879<\/p>\n

\/usr\/bin\/passwd\u201d\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u53d6\u6d88\u201cpasswd\u201d\u547d\u4ee4\u7684setuid\u6743\u9650\uff0c\u8fd9\u6837\u666e\u901a\u7528\u6237\u5c31\u96be\u4ee5\u66f4\u6539\u81ea\u5df1\u7684\u5bc6\u7801\u4e86\u3002<\/p>\n

linux\u542f\u52a8\u547d\u4ee4\uff1f<\/p>\n

\u4e00\uff1a\u542f\u52a8Nginx\u670d\u52a1--\u5728sbin\u76ee\u5f55\u4e0b<\/p>\n

\u542f\u52a8\u547d\u4ee4:.\/nginx<\/p>\n

\u5173\u6389\u547d\u4ee4:.\/nginx-sstop\u548c.\/nginx-squit<\/p>\n

\u5237\u65b0\u914d\u7f6e\u6587\u4ef6:.\/nginx-sreload(\u6bcf\u6b21\u5bf9Nginx\u7684\u914d\u7f6e\u6587\u4ef6nginx.conf\u66f4\u6539\u540elinux\u542f\u52a8nginx\u547d\u4ee4<\/strong>\uff0c\u90fd\u8981\u8fdb\u884c\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6)<\/p>\n

\u4e8c\uff1a\u8fdb\u7a0b<\/p>\n

\u67e5\u770b\u8fdb\u7a0bps-ef|grep-ixxxx-i\u5927\u7ea6\u662fignore\u662f\u5ffd\u89c6\u7684\u610f\u601d\u8fd9\u513f\u662f\u5ffd\u89c6\u5927\u5c0f\u5199\u3002<\/p>\n

\u6740\u5bb3\u8fdb\u7a0bkill-9xxxx<\/p>\n

\u4e09\uff1a\u9632\u706b\u5899<\/p>\n

\u5f00\u542f\u9632\u706b\u5899serviceiptablesstart<\/p>\n

\u5173\u6389\u9632\u706b\u5899serviceiptablesstop<\/p>\n

\u67e5\u770b\u9632\u706b\u5899\u7684\u72b6\u6001serviceiptablesstatus<\/p>\n

\u6c38\u4e45\u5173\u6389\u9632\u706b\u5899chkconfigiptablesoff<\/p>\n

\u56db\uff1a\u542f\u52a8zookeeper\u670d\u52a1--\u5728zookeeper\u7684bin\u76ee\u5f55\u4e0b<\/p>\n

\u5f00\u542fzookeeper\u670d\u52a1\uff1a.\/zkServer.shstart<\/p>\n

\u67e5\u770bzookeeper\u72b6\u6001.\/zkServer.shstatus<\/p>\n

\u4e94\uff1a\u542f\u52a8Redis\u670d\u52a1--\u5728redis\u7684bin\u76ee\u5f55\u4e0b<\/p>\n

\u4ee5\u540e\u53f0\u7684\u65b9\u6cd5\u542f\u52a8\uff1a.\/redis-server..\/redis.conf(\u65c1\u8fb9\u7684\u7684redis.conf\u8def\u5f84\u8981\u6309\u7167\u6bcf\u4f4d\u4eba\u914d\u7f6e\u6587\u4ef6\u50a8\u5b58\u7684\u4f4d\u7f6e\u6765\u5199)<\/p>\n

\u6b65\u5165redis\u547d\u4ee4\u670d\u52a1\uff1a.\/redis-cli<\/p>\n

\u8f93\u5165\uff1aping\u5047\u5982\u8fd4\u56depong\u5219\u8868\u793a\u8054\u63a5\u6210\u529f\uff01<\/p>\n

\u516d.\u542f\u52a8tomcat\u670d\u52a1<\/p>\n

linux\u542f\u52a8nginx\u547d\u4ee4_\u547d\u4ee4\u542f\u52a8\u9879_\u547d\u4ee4\u542f\u52a8jar\u5305<\/p>\n

Linux<\/a>\u4e0btomcat\u670d\u52a1\u7684\u542f\u52a8\u3001\u5173\u95ed\u4e0e\u9519\u8bef\u8ddf\u8e2a\uff0c\u4f7f\u7528PuTTy\u8fdc\u7a0b\u8054\u63a5\u5230\u670d\u52a1\u5668\u4e4b\u540e\uff0c\u4e00\u822c\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u542f\u52a8\u5173\u6389tomcat\u670d\u52a1\uff1a<\/p>\n

\u5207\u6362\u5230tomcat\u4e3b\u76ee\u5f55\u4e0b\u7684bin\u76ee\u5f55\uff08cdusr\/local\/tomcat\/bin\uff09<\/p>\n

1\uff0c\u542f\u52a8tomcat\u670d\u52a1<\/p>\n

\u5f62\u5f0f\u4e00\uff1a\u76f4\u63a5\u542f\u52a8.\/startup.sh<\/p>\n

\u5f62\u5f0f\u4e8c\uff1a\u4f5c\u4e3a\u670d\u52a1\u542f\u52a8nohup.\/startup.sh<\/p>\n

\u5f62\u5f0f\u4e09\uff1a\u63a7\u5236\u53f0\u52a8\u6001\u8f93\u51fa\u5f62\u5f0f\u542f\u52a8.\/catalina.shrun\u52a8\u6001\u5730\u663e\u793atomcat\u540e\u53f0\u7684\u63a7\u5236\u53f0\u8f93\u51fa\u4fe1\u606f,Ctrl+C\u540e\u9000\u51fa\u5e76\u5173\u6389\u670d\u52a1<\/p>\n

\u89e3\u91ca\uff1a<\/p>\n

\u901a\u8fc7\u65b9\u6cd5\u4e00\u3001\u65b9\u5f0f\u4e09\u542f\u52a8\u7684tomcat\u6709\u4e2a\u9690\u5fe7\uff0c\u5f53\u987e\u5ba2\u7aef\u8054\u63a5\u65ad\u6389\u7684\u65f6\u4faf\uff0ctomcat\u670d\u52a1\u4e5f\u4f1a\u7acb\u523b\u505c\u6b62\uff0c\u901a\u8fc7\u65b9\u6cd5\u4e8c\u53ef\u4ee5\u4f5c\u4e3alinux\u670d\u52a1\u4ecd\u7136\u8fd0\u884c<\/p>\n

\u901a\u8fc7\u65b9\u6cd5\u4e00\u3001\u65b9\u5f0f\u4e8c\u5f62\u5f0f\u542f\u52a8\u7684tomcat\uff0c\u5176\u65e5\u5fd7\u4f1a\u8bb2\u5230\u76f8\u5e94\u7684\u65e5\u5fd7\u6587\u4ef6\u4e2dlinux\u542f\u52a8nginx\u547d\u4ee4<\/strong>\uff0c\u800c\u4e0d\u80fd\u52a8\u6001\u5730\u67e5\u770btomcat\u63a7\u5236\u53f0\u7684\u8f93\u51fa\u4fe1\u606f\u4e0e\u9519\u8bef\u60c5\u51b5\uff0c\u901a\u8fc7\u65b9\u6cd5\u4e09\u53ef\u4ee5\u4ee5\u63a7\u5236\u53f0\u6a21\u5f0f\u542f\u52a8tomcat\u670d\u52a1\uff0c<\/p>\n

\u76f4\u63a5\u770b\u89c1\u7a0b\u5e8f\u8fd0\u884c\u65f6\u540e\u53f0\u7684\u63a7\u5236\u53f0\u8f93\u51fa\u4fe1\u606f\uff0c\u6bcb\u987b\u6bcf\u6b21\u90fd\u8981\u5f88\u9ebb\u70e6\u7684\u6253\u5f00catalina.out\u65e5\u5fd7\u6587\u4ef6\u8fdb\u884c\u67e5\u770b\uff0c\u8fd9\u6837\u4ee5\u4fbf\u8ddf\u8e2a\u67e5\u9605\u540e\u53f0\u8f93\u51fa\u4fe1\u606f\u3002tomcat\u63a7\u5236\u53f0\u4fe1\u606f\u5305\u62eclog4j\u548cSystem.out.println()\u7b49\u8f93\u51fa\u7684\u4fe1\u606f\u3002<\/p>\n

2\uff0c\u5173\u6389tomcat\u670d\u52a1<\/p>\n

.\/shutdown.sh<\/p>\n

\u4e03>\u542f\u52a8\u6570\u636e\u5e93:<\/p>\n

servicemysqldstart\u542f\u52a8<\/p>\n

servicemysqldrestart\u91cd\u542f<\/p>\n

shell\u6587\u4ef6\u5982\u4f55\u8fd4\u56delinux\u64cd\u4f5c\u754c\u9762\uff1f<\/p>\n

\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4return\u6765\u8fd4\u56delinux\u64cd\u4f5c\u754c\u9762\u3002<\/p>\n

Linux<\/a>\u5982\u4f55\u8fd8\u539f\u7cfb\u7edf\uff1f<\/p>\n

\u50cf\u8fd9\u4e9b\u60c5\u51b5\u7528\u4ee5\u4e0b\u4ecb\u7ecd\u7684\u65b9\u5f0f\u548c\u6b65\u9aa4\u5c31\u53ef\u4ee5\u89e3\u51b3:<\/p>\n

linux\u6062\u590d\u5220\u6389\u7684\u6587\u4ef6\u65b9\u5f0f\uff1a\u9996\u5148\u8df3\u8f6c\u81f3\u5df2\u5220\u6389\u6587\u4ef6\u8def\u5f84\u4e0b\uff1b\u4e4b\u540e\u501f\u52a9\u7cfb\u7edf\u81ea\u5e26\u7684\u8fd8\u539f\u5de5\u5177debugfs\u6765\u4fee\u8865linux qq\uff0c\u5e76\u8fd0\u884c\u76f8\u5173\u6307\u4ee4\u627e\u5230\u5220\u6389\u7684\u6587\u4ef6\uff1b\u63a5\u7740\u6267\u884c\u547d\u4ee4\u5f97\u5230\u4fe1\u606f\uff1b\u6700\u540e\u8fd4\u56de\u8def\u5f84\u5373\u53ef\u3002<\/p>\n

\u6709\u987b\u8981\u7684\u7537\u5b50\u4f34\u53ef\u4ee5\u6839\u636e\u524d\u9762\u7684\u6b65\u9aa4\u6765\u64cd\u4f5c\u54e6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

linux\u542f\u52a8\u547d\u4ee4\uff1f\u4e00\uff1a\u542f\u52a8Nginx\u670d\u52a1–\u5728sbin\u76ee\u5f55\u4e0b\u542f\u52a8\u547d\u4ee4:.\/nginx\u4e94\uff1a\u542f\u52a8Redis\u670d\u52a1–\u5728redis\u7684bin\u76ee\u5f55\u4e0b\u8fdb\u5165redis\u547d\u4ee4\u670d\u52a1\uff1a.\/redis-clishell\u6587\u4ef6\u600e\u4e48\u8fd4\u56delinux\u64cd\u4f5c\u754c\u9762\uff1f\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4return\u6765\u8fd4\u56delinux\u64cd\u4f5c\u754c\u9762\u3002<\/p>\n","protected":false},"author":1,"featured_media":294949,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[1569,1183,109,4883,4882],"class_list":["post-294948","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-c-13","tag-i-3","tag-linux","tag-passwd","tag-setuid"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294948","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=294948"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294948\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/294949"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=294948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=294948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=294948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}