{"id":6,"date":"2024-08-19T16:07:43","date_gmt":"2024-08-19T08:07:43","guid":{"rendered":"http:\/\/aaaabbbb.top\/?p=6"},"modified":"2024-08-19T16:07:43","modified_gmt":"2024-08-19T08:07:43","slug":"linux%e4%b8%8b%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%90%88%e9%9b%86","status":"publish","type":"post","link":"https:\/\/aaaabbbb.top\/index.php\/2024\/08\/19\/linux%e4%b8%8b%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%90%88%e9%9b%86\/","title":{"rendered":"Linux\u4e0b\u5e38\u7528\u547d\u4ee4\u5927\u5408\u96c6"},"content":{"rendered":"\n<p><strong>Linux\u662f\u4ec0\u4e48<\/strong><\/p>\n\n\n\n<p>Linux\u662f\u4e00\u79cd\u514d\u8d39\u3001\u5f00\u6e90\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u7531\u6797\u7eb3\u65af\u00b7\u6258\u74e6\u5179\u57281991\u5e74\u521b\u5efa\u3002Linux\u57fa\u4e8eUnix\u64cd\u4f5c\u7cfb\u7edf\uff0c\u91c7\u7528\u4e86\u5206\u5c42\u7684\u8bbe\u8ba1\u601d\u60f3\uff0c\u652f\u6301\u591a\u7528\u6237\u3001\u591a\u4efb\u52a1\u3001\u591a\u7ebf\u7a0b\u7684\u64cd\u4f5c\uff0c\u5e76\u5177\u6709\u826f\u597d\u7684\u7a33\u5b9a\u6027\u548c\u5b89\u5168\u6027\u3002Linux\u5177\u6709\u9ad8\u5ea6\u7684\u53ef\u5b9a\u5236\u6027\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u81ea\u7531\u5730\u914d\u7f6e\u548c\u4fee\u6539\u7cfb\u7edf\u3002Linux\u5e7f\u6cdb\u7528\u4e8e\u670d\u52a1\u5668\u3001\u684c\u9762\u7535\u8111\u3001\u79fb\u52a8\u8bbe\u5907\u7b49\u9886\u57df\u3002<\/p>\n\n\n\n<p><strong>Ubuntu\u3001Debian\u3001CentOS\u53c8\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n\n\n\n<p>Linux\u662f\u4e00\u79cd\u5f00\u653e\u6e90\u4ee3\u7801\u7684\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\uff0c\u800cUbuntu\u3001Debian\u3001CentOS\u7b49\u662f\u57fa\u4e8eLinux\u5185\u6838\u5f00\u53d1\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002\u5b83\u4eec\u90fd\u4f7f\u7528\u4e86Linux\u5185\u6838\uff0c\u5e76\u4e14\u62e5\u6709\u81ea\u5df1\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u3001\u6587\u4ef6\u7cfb\u7edf\u3001\u547d\u4ee4\u884c\u754c\u9762\u7b49\u7b49\u3002\u8fd9\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u5728\u7ec6\u8282\u548c\u7279\u6027\u4e0a\u53ef\u80fd\u6709\u6240\u4e0d\u540c\uff0c\u4f46\u90fd\u9075\u5faaLinux\u5185\u6838\u7684\u8bbe\u8ba1\u548c\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p><strong>\u5b9e\u6218<\/strong><\/p>\n\n\n\n<p>\u672c\u6587\u5e26\u5165\u5b9e\u9645\u7684\u6587\u4ef6\u4e0e\u76ee\u5f55\uff0c\u6765\u5206\u4eab\u5e38\u7528\u7684Linux\u547d\u4ee4\uff0c\u76ee\u7684\u65b9\u4fbf\u5927\u5bb6\u5b66\u4e60\u548c\u7406\u89e3\u3002\u547d\u4ee4\u53ef\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u4f7f\u7528\u3002\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-8-300x156.png\"><img decoding=\"async\" src=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-8-300x156.png\" alt=\"\" class=\"wp-image-96\"\/><\/a><\/figure>\n\n\n\n<p><strong>ubuntu\/debian<\/strong><strong>\u5305<\/strong><strong>\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u7cfb\u7edf\u6240\u6709<\/strong><\/p>\n\n\n\n<p>apt update<\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u73b0\u6709\u8f6f\u4ef6<\/strong><\/p>\n\n\n\n<p>apt upgrade -y<\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u8f6f\u4ef6\u4f9d\u8d56\u5173\u7cfb<\/strong><strong>\u66f4\u65b0\u73b0\u6709\u8f6f\u4ef6\u5220\u9664\u4f9d\u8d56\u4ee5\u5916\u7684\u8f6f\u4ef6<\/strong><\/p>\n\n\n\n<p>apt full-upgrade -y<\/p>\n\n\n\n<p><strong>\u5b89\u88c5\u6216\u66f4\u65b0\u6307\u5b9a\u8f6f\u4ef6\u5982\uff1acurl wget<\/strong><\/p>\n\n\n\n<p>apt install -y curl wget<\/p>\n\n\n\n<p><strong>\u5220\u9664\u6307\u5b9a\u8f6f\u4ef6<\/strong><strong>\u5982\uff1acurl wget<\/strong><\/p>\n\n\n\n<p>apt remove -y curl wget<\/p>\n\n\n\n<p>apt purge -y curl wget<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-9-1024x249.png\"><img decoding=\"async\" src=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-9-1024x249.png\" alt=\"\" class=\"wp-image-98\"\/><\/a><\/figure>\n\n\n\n<p><strong>Alpine Linux<\/strong><strong>\u5305<\/strong><strong>\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u7cfb\u7edf\u6240\u6709<\/strong><\/p>\n\n\n\n<p>apk update<\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u73b0\u6709\u8f6f\u4ef6<\/strong><\/p>\n\n\n\n<p>apk upgrade<\/p>\n\n\n\n<p><strong>\u5b89\u88c5\u6216\u66f4\u65b0\u6307\u5b9a\u8f6f\u4ef6\u5982\uff1acurl docker<\/strong><\/p>\n\n\n\n<p>apk add curl docker<\/p>\n\n\n\n<p><strong>\u5220\u9664\u6307\u5b9a\u8f6f\u4ef6<\/strong><strong>\u5982\uff1acurl wget<\/strong><\/p>\n\n\n\n<p>apk del wget<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-10-1024x346.png\"><img decoding=\"async\" src=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-10-1024x346.png\" alt=\"\" class=\"wp-image-99\"\/><\/a><\/figure>\n\n\n\n<p><strong>CentOS\u5305\u7ba1\u7406\u547d\u4ee4<\/strong><\/p>\n\n\n\n<p><strong>\u66f4\u65b0\u7cfb\u7edf\u6240\u6709<\/strong><\/p>\n\n\n\n<p>yum update<\/p>\n\n\n\n<p><strong>\u5b89\u88c5\u6216\u66f4\u65b0\u6307\u5b9a\u8f6f\u4ef6\u5982\uff1acurl wget<\/strong><\/p>\n\n\n\n<p>yum&nbsp;install -y curl wget<\/p>\n\n\n\n<p><strong>\u5220\u9664\u6307\u5b9a\u8f6f\u4ef6<\/strong><strong>\u5982\uff1acurl wget<\/strong><\/p>\n\n\n\n<p>yum remove -y curl wget<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-11.png\"><img decoding=\"async\" src=\"https:\/\/blog.kejilion.pro\/wp-content\/uploads\/2024\/02\/image-11.png\" alt=\"\" class=\"wp-image-100\"\/><\/a><\/figure>\n\n\n\n<p><strong>\u6587\u4ef6\u7ba1\u7406\u76f8\u5173<\/strong><\/p>\n\n\n\n<p><strong>\u67e5\u770bhome\u76ee\u5f55\u4e0b\u5185\u5bb9<\/strong><\/p>\n\n\n\n<p>ls \/home\/<\/p>\n\n\n\n<p><strong>\u8fdb\u5165home\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>cd \/home<\/p>\n\n\n\n<p><strong>\u521b\u5efaweb\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>mkdir web<\/p>\n\n\n\n<p><strong>\u521b\u5efa\u7a7anginx.conf\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>touch nginx.conf<\/p>\n\n\n\n<p><strong>\u7f16\u8f91docker-compose.yml\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>nano docker-compose.yml<\/p>\n\n\n\n<p><strong>\u538b\u7f29\/home\/web\u76ee\u5f55\uff0c\u538b\u7f29\u5305\u5b58\u653e\u5230\u5f53\u524d\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>tar -czvf web.tar.gz \/home\/web<\/p>\n\n\n\n<p><strong>\u5f53\u524d\u76ee\u5f55\u89e3\u538bweb.tar.gz\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>tar -xzvf web.tar.gz<\/p>\n\n\n\n<p><strong>\u5220\u9664home\/web\u76ee\u5f55\u4e0b\u6240\u6709\u5185\u5bb9<\/strong><\/p>\n\n\n\n<p>rm -r \/home\/web\/*<\/p>\n\n\n\n<p><strong>\u5220\u9664\/home\/web.tar.gz\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>rm \/home\/web.tar.gz<\/p>\n\n\n\n<p><strong>\u4e0b\u8f7dmaccms10.zip\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>wget https:\/\/github.com\/magicblack\/maccms_down\/raw\/master\/maccms10.zip<\/p>\n\n\n\n<p><strong>\u79fb\u52a8home\/web\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u5230root\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>mv \/home\/web\/* \/root\/<\/p>\n\n\n\n<p><strong>\u62f7\u8d1dhome\/web\u76ee\u5f55\u5230root<\/strong><\/p>\n\n\n\n<p>cp -r \/home\/web \/root<\/p>\n\n\n\n<p><strong>\u62f7\u8d1dhome\/web\u76ee\u5f55\u4e0b\u7684test.txt\u5230root<\/strong><\/p>\n\n\n\n<p>cp \/home\/web\/test.txt \/root<\/p>\n\n\n\n<p><strong>\u8d4b\u4e88\/var\/www\/html\u6700\u9ad8\u8bfb\u5199\u6743\u9650<\/strong><\/p>\n\n\n\n<p>chmod -R 777 \/var\/www\/html<\/p>\n\n\n\n<p><strong>\u5c06home\u76ee\u5f55\u4e0b\u7684test.txt\u6539\u540d\u6210root.txt<\/strong><\/p>\n\n\n\n<p>mv \/home\/test.txt \/home\/root.txt<\/p>\n\n\n\n<p><strong>\u5c06root.txt\u4e2d\u6240\u6709\u7684test\u66ff\u6362\u6210root<\/strong><\/p>\n\n\n\n<p>sed -i &#8216;s\/test\/root\/g&#8217; root.txt<\/p>\n\n\n\n<p><strong>\u5c06root.txt\u6587\u4ef6\u6240\u6709\u5185\u5bb9\u5220\u9664\u6dfb\u52a0\u4e00\u884c\u6587\u672croot=12345\u4fdd\u5b58\u9000\u51fa<\/strong><\/p>\n\n\n\n<p>cat &gt; \/home\/root.txt &lt;&lt; EOF<\/p>\n\n\n\n<p>root=12345<\/p>\n\n\n\n<p>EOF<\/p>\n\n\n\n<p><strong>\u5728root.txt\u6587\u672c\u4e2d\u672b\u5c3e\u6dfb\u52a0\u4e00\u884cend=yyds<\/strong><\/p>\n\n\n\n<p>echo &#8220;end=yyds&#8221; &gt;&gt; root.txt<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u662f\u4ec0\u4e48 Linux\u662f\u4e00\u79cd\u514d\u8d39\u3001\u5f00\u6e90\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u7531\u6797&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":1,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":7,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/posts\/6\/revisions\/7"}],"wp:attachment":[{"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aaaabbbb.top\/index.php\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}