{"id":764,"date":"2023-02-25T11:36:35","date_gmt":"2023-02-25T03:36:35","guid":{"rendered":"http:\/\/blog.nonot.cn\/?p=764"},"modified":"2024-07-08T12:50:13","modified_gmt":"2024-07-08T04:50:13","slug":"linux%e6%9f%a5%e7%9c%8b%e7%ab%af%e5%8f%a3%e5%b9%b6%e4%b8%94%e6%96%b0%e5%a2%9e%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/blog.nonot.cn\/index.php\/2023\/02\/25\/linux%e6%9f%a5%e7%9c%8b%e7%ab%af%e5%8f%a3%e5%b9%b6%e4%b8%94%e6%96%b0%e5%a2%9e%e7%ab%af%e5%8f%a3\/","title":{"rendered":"linux\u67e5\u770b\u7aef\u53e3,\u5e76\u4e14\u65b0\u589e\u7aef\u53e3"},"content":{"rendered":"<p>linux\u67e5\u770b\u7aef\u53e3,\u5e76\u4e14\u65b0\u589e\u7aef\u53e3<\/p>\n<p>1.firewall-cmd &#8211;list-ports<\/p>\n<p>2.netstat \u5de5\u5177\u68c0\u6d4b\u5f00\u653e\u7aef\u53e3 netstat -anlp | grep 3306 \u65b0\u589e8081\u7aef\u53e3<\/p>\n<p>3. iptables -A INPUT -p tcp &#8211;dport 8081 -j ACCEPT #iptables -I INPUT 5 -p tcp &#8211;dport 2223 -j ACCEPT #iptables -A OUTPUT -p tcp &#8211;dport 2223 -j ACCEPT 4.service iptables save<\/p>\n<p>5.\u5f00\u542f80\u7aef\u53e3 firewall-cmd &#8211;zone=public(\u4f5c\u7528\u57df) &#8211;add-port=80\/tcp(\u7aef\u53e3\u548c\u8bbf\u95ee\u7c7b\u578b) &#8211;permanent(\u6c38\u4e45\u751f\u6548) firewall-cmd &#8211;zone=public &#8211;add-port=80\/tcp &#8211;permanent<\/p>\n<p>6.\u91cd\u542f\u9632\u706b\u5899 firewall-cmd &#8211;reload<\/p>\n<p>7.\u505c\u6b62\u9632\u706b\u5899 systemctl stop firewalld.service<\/p>\n<p>8.\u7981\u6b62\u9632\u706b\u5899\u5f00\u673a\u542f\u52a8 systemctl disable firewalld.service<\/p>\n<p>9.\u5220\u9664 firewall-cmd &#8211;zone= public &#8211;remove-port=80\/tcp &#8211;permanent<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u67e5\u770b\u7aef\u53e3,\u5e76\u4e14\u65b0\u589e\u7aef\u53e3 1.firewall-cm&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-764","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/comments?post=764"}],"version-history":[{"count":1,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/764\/revisions"}],"predecessor-version":[{"id":1202,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/764\/revisions\/1202"}],"wp:attachment":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/media?parent=764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/categories?post=764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/tags?post=764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}