{"id":13582,"date":"2025-12-11T15:22:48","date_gmt":"2025-12-11T07:22:48","guid":{"rendered":"https:\/\/www.ldhost.cn\/jc\/?p=13582"},"modified":"2025-12-11T15:23:53","modified_gmt":"2025-12-11T07:23:53","slug":"5-%e7%a7%8d%e6%a3%80%e6%9f%a5-linux-%e7%b3%bb%e7%bb%9f%e5%b7%b2%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a3%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.ldhost.cn\/jc\/linux\/13582.html","title":{"rendered":"5 \u79cd\u68c0\u67e5 Linux \u7cfb\u7edf\u5df2\u5f00\u653e\u7aef\u53e3\u7684\u65b9\u6cd5"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"303\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/20251211-151949.png\" alt=\"\" class=\"wp-image-13583\" srcset=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/20251211-151949.png 563w, https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/20251211-151949-300x161.png 300w, https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/20251211-151949-150x81.png 150w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/figure>\n\n\n\n<p>\u7aef\u53e3\u5c31\u50cf\u95e8\u4e00\u6837\uff0c\u5141\u8bb8 Linux \u7cfb\u7edf\u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u7a0b\u5e8f\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\u3002\u5982\u679c\u60a8\u60f3\u67e5\u770b\u54ea\u4e9b\u7aef\u53e3\u6b63\u5728\u4f7f\u7528\u3001\u54ea\u4e9b\u7aef\u53e3\u5904\u4e8e\u5f00\u653e\u72b6\u6001\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ec0\u4e48\u662f\u7aef\u53e3\uff1f<\/h2>\n\n\n\n<p>\u5728\u6df1\u5165\u4e86\u89e3\u547d\u4ee4\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u82b1\u70b9\u65f6\u95f4\u4e86\u89e3\u4e00\u4e0b\u4ec0\u4e48\u662f\u7aef\u53e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7aef\u53e3\u53f7\u662f\u7528\u4e8e\u6807\u8bc6\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u7684\u7279\u5b9a\u7a0b\u5e8f\u6216\u5e94\u7528\u7684\u7f16\u53f7\u3002\u4f8b\u5982\uff1a\n<ul class=\"wp-block-list\">\n<li>Web \u670d\u52a1\u5668\u7aef\u53e3\u901a\u5e38\u4f7f\u7528<strong>\u7aef\u53e3 80<\/strong>\uff08HTTP\uff09\u6216<strong>\u7aef\u53e3 443<\/strong>\uff08HTTPS\uff09\u3002<\/li>\n\n\n\n<li>\u901a\u8fc7 SSH \u8fdb\u884c\u8fdc\u7a0b\u767b\u5f55\u901a\u5e38\u4f7f\u7528<strong>\u7aef\u53e3 22<\/strong>\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6bcf\u4e2a\u7aef\u53e3\u90fd\u6709\u4e00\u4e2a\u4ecb\u4e8e0 \u5230 65535<\/strong>\u4e4b\u95f4\u7684\u6570\u5b57\uff0c\u8fd9\u4e9b\u6570\u5b57\u5206\u4e3a\u4e09\u4e2a\u4e3b\u8981\u7ec4\uff1a\n<ul class=\"wp-block-list\">\n<li><strong>0\u20131023<\/strong>\uff1a\u4fdd\u7559\u7ed9 HTTP \u548c FTP \u7b49\u5e38\u7528\u534f\u8bae\u3002<\/li>\n\n\n\n<li><strong>1024\u201349151<\/strong>\uff1a\u7528\u4e8e\u60a8\u5b89\u88c5\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li><strong>49152\u201365535<\/strong>\uff1a\u5e94\u7528\u7a0b\u5e8f\u8fde\u63a5\u5230\u670d\u52a1\u65f6\u4f7f\u7528\u7684\u4e34\u65f6\u7aef\u53e3\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u4e4b\u540e\uff0c\u6211\u4eec\u6765\u5982\u4f55\u68c0\u67e5\u7aef\u53e3\u7684\u8fd0\u884c\u72b6\u51b5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5982\u4f55\u5728Linux\u4e2d\u68c0\u67e5\u7aef\u53e3<\/h2>\n\n\n\n<p>Linux \u63d0\u4f9b\u4e86\u8bb8\u591a\u5de5\u5177\u6765\u5e2e\u52a9\u60a8\u68c0\u67e5\u5f00\u653e\u6216\u76d1\u542c\u7684\u7aef\u53e3\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u4e94\u79cd\u5e38\u7528\u65b9\u6cd5\uff0c\u5e76\u89e3\u91ca\u6bcf\u79cd\u65b9\u6cd5\u7684\u4f5c\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u4f7f\u7528 netstat<\/h3>\n\n\n\n<p>netstat \u547d\u4ee4\u53ef\u4ee5\u8be6\u7ec6\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u548c\u7aef\u53e3\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n\n\n\n<p><strong>\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>netstat&nbsp;-tuln<\/code><\/pre>\n\n\n\n<p><strong>\u4ee5\u4e0b\u662f\u6bcf\u4e2a\u9009\u9879\u7684\u542b\u4e49\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>-t<\/strong>\uff1a\u663e\u793a TCP\uff08\u4f20\u8f93\u63a7\u5236\u534f\u8bae\uff09\u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>-u<\/strong>\uff1a\u663e\u793aUDP\uff08\u7528\u6237\u6570\u636e\u62a5\u534f\u8bae\uff09\u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>-l<\/strong>\uff1a\u4ec5\u663e\u793a\u6b63\u5728\u76d1\u542c\u7684\u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>-n<\/strong>\uff1a\u8df3\u8fc7\u5c06\u7a0b\u5e8f\u540d\u79f0\uff08\u4f8b\u5982\u201cssh\u201d\uff09\u8f6c\u6362\u4e3a\u7aef\u53e3\u53f7\uff0c\u8fd9\u6837\u901f\u5ea6\u4f1a\u66f4\u5feb\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u60a8\u5c06\u770b\u5230\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Proto Recv-Q Send-Q Local Address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Foreign Address &nbsp; &nbsp; &nbsp; &nbsp; State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\ntcp&nbsp; &nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0 0.0.0.0:22&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0:* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LISTEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nudp&nbsp; &nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0 0.0.0.0:68&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0:*<\/code><\/pre>\n\n\n\n<p><strong>\u4ee5\u4e0b\u662f\u9605\u8bfb\u672c\u6587\u7684\u65b9\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Proto\uff1a<\/strong>\u663e\u793a\u662f TCP \u8fd8\u662f UDP\u3002<\/li>\n\n\n\n<li><strong>\u672c\u5730\u5730\u5740\uff1a<\/strong>\u60a8\u673a\u5668\u7684 IP \u5730\u5740\u548c\u6b63\u5728\u4f7f\u7528\u7684\u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>\u56fd\u5916\u5730\u5740\uff1a<\/strong>\u53e6\u4e00\u53f0\u673a\u5668\u7684 IP \u5730\u5740\u548c\u7aef\u53e3\uff08\u5982\u679c\u5bf9\u6240\u6709\u4eba\u5f00\u653e\uff0c\u5219\u7528 * \u8868\u793a\uff09\u3002<\/li>\n\n\n\n<li><strong>\u72b6\u6001\uff1a<\/strong>\u5bf9\u4e8e TCP \u800c\u8a00\uff0cLISTEN \u8868\u793a\u5b83\u6b63\u5728\u7b49\u5f85\u8fde\u63a5\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b80\u8981\u8bf4\u660e\uff1a<\/strong>&nbsp;netstat \u662f net-tools \u8f6f\u4ef6\u5305\u7684\u4e00\u90e8\u5206\uff0c\u800c\u8f83\u65b0\u7684 Linux \u7248\u672c\u53ef\u80fd\u672a\u9884\u88c5\u8be5\u8f6f\u4ef6\u5305\u3002\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo&nbsp;apt&nbsp;install&nbsp;net-tools&nbsp;&nbsp;#&nbsp;On&nbsp;Debian\/Ubuntu&nbsp;&nbsp;\nsudo&nbsp;yum&nbsp;install&nbsp;net-tools&nbsp;&nbsp;#&nbsp;On&nbsp;RHEL\/CentOS&nbsp;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u4f7f\u7528 ss<\/h3>\n\n\n\n<p><strong>ss<\/strong>\u662f netstat \u7684\u4e00\u4e2a\u66f4\u65b0\u3001\u66f4\u5feb\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u63d0\u4f9b\u7684\u4fe1\u606f\u7c7b\u4f3c\uff0c\u4f46\u5728\u73b0\u4ee3\u7cfb\u7edf\u4e0a\u8fd0\u884c\u5f97\u66f4\u597d\u3002<\/p>\n\n\n\n<p><strong>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss&nbsp;-tuln<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e9b\u9009\u9879\u4e0e netstat \u76f8\u540c\uff0c\u6240\u4ee5\u4f60\u5e94\u8be5\u80fd\u591f\u7acb\u5373\u4e0a\u624b\u3002<\/p>\n\n\n\n<p><strong>\u60a8\u5c06\u770b\u5230\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Netid &nbsp; State&nbsp; &nbsp; &nbsp; Recv-Q Send-Q Local Address:Port &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Peer Address:Port\ntcp &nbsp; &nbsp; LISTEN &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 128&nbsp; &nbsp; 0.0.0.0:22&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nudp &nbsp; &nbsp; UNCONN &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0.0.0.0:68&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0:*<\/code><\/pre>\n\n\n\n<p>\u8be5\u8f93\u51fa\u4e0e netstat \u7c7b\u4f3c\uff0c\u4f46<strong>ss \u7684<\/strong>\u901f\u5ea6\u5f80\u5f80\u66f4\u5feb\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u5927\u91cf\u8fde\u63a5\u65f6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u4f7f\u7528 lsof<\/h3>\n\n\n\n<p><strong>lsof<\/strong>\uff08\u5217\u51fa\u6253\u5f00\u7684\u6587\u4ef6\uff09\u662f\u4e00\u4e2a\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u67e5\u770b\u54ea\u4e9b\u6587\u4ef6\u6216\u7f51\u7edc\u8fde\u63a5\u6b63\u5728\u88ab\u8fdb\u7a0b\u4f7f\u7528\u3002<\/p>\n\n\n\n<p><strong>\u8981\u67e5\u770b\u54ea\u4e9b\u7aef\u53e3\u5df2\u6253\u5f00\u4ee5\u53ca\u54ea\u4e9b\u7a0b\u5e8f\u6b63\u5728\u4f7f\u7528\u8fd9\u4e9b\u7aef\u53e3\uff0c\u8bf7\u8fd0\u884c\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo&nbsp;lsof&nbsp;-i&nbsp;-P&nbsp;-n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>-i<\/strong>\uff1a\u7f51\u7edc\u76f8\u5173\u6587\u4ef6\u7684\u8fc7\u6ee4\u5668\u3002<\/li>\n\n\n\n<li><strong>-P<\/strong>\uff1a\u663e\u793a\u539f\u59cb\u7aef\u53e3\u53f7\u800c\u4e0d\u662f\u670d\u52a1\u540d\u79f0\u3002<\/li>\n\n\n\n<li><strong>-n<\/strong>\uff1a\u4e3a\u4e86\u63d0\u9ad8\u901f\u5ea6\uff0c\u8df3\u8fc7\u5c06 IP \u5730\u5740\u8f6c\u6362\u4e3a\u4e3b\u673a\u540d\u7684\u6b65\u9aa4\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u60a8\u5c06\u770b\u5230\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>COMMAND &nbsp; PID&nbsp; USER &nbsp; FD &nbsp; TYPE DEVICE SIZE\/OFF NODE NAME\nsshd&nbsp; &nbsp; &nbsp; 1234 root &nbsp; 3u&nbsp; IPv4&nbsp; 12345&nbsp; &nbsp; &nbsp; 0t0&nbsp; TCP *:22 (LISTEN)\ndhclient&nbsp; 5678 root &nbsp; 6u&nbsp; IPv4&nbsp; 54321&nbsp; &nbsp; &nbsp; 0t0&nbsp; UDP *:68<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u547d\u4ee4<\/strong>\uff1a\u4f7f\u7528\u8be5\u7aef\u53e3\u7684\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li><strong>PID<\/strong>\uff1a\u8fdb\u7a0b ID\u3002<\/li>\n\n\n\n<li><strong>\u540d\u79f0<\/strong>\uff1a\u7aef\u53e3\u548c\u534f\u8bae\uff08\u4f8b\u5982\uff0c\u7aef\u53e3 22 \u4e0a\u7684 TCP\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b83\u7684\u4f18\u52bf\uff1a<\/h4>\n\n\n\n<p>\u5982\u679c\u60a8\u6b63\u5728\u8fdb\u884c\u6545\u969c\u6392\u9664\uff0c\u9700\u8981\u627e\u51fa\u54ea\u4e2a\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u7279\u5b9a\u7aef\u53e3\uff0c<strong>lsof<\/strong>\u5c31\u662f\u60a8\u7684\u9996\u9009\u5de5\u5177\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u4f7f\u7528 nmap<\/h3>\n\n\n\n<p><strong>nmap<\/strong>\uff08\u7f51\u7edc\u6620\u5c04\u5668\uff09\u975e\u5e38\u9002\u5408\u626b\u63cf\u7f51\u7edc\u5e76\u68c0\u67e5\u54ea\u4e9b\u7aef\u53e3\u662f\u5f00\u653e\u7684\u3002<\/p>\n\n\n\n<p><strong>\u8981\u626b\u63cf\u6240\u6709\u7aef\u53e3\uff0c\u8bf7\u8fd0\u884c\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo&nbsp;nmap&nbsp;-sT&nbsp;-p-&nbsp;localhost<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>-sT<\/strong>\uff1a\u6267\u884c TCP \u8fde\u63a5\u626b\u63cf\u3002<\/li>\n\n\n\n<li><strong>-p-<\/strong>\uff1a\u626b\u63cf\u6240\u6709 65,535 \u4e2a\u7aef\u53e3\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u60a8\u5c06\u770b\u5230\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PORT &nbsp; &nbsp; STATE SERVICE\n22\/tcp &nbsp; open&nbsp; ssh\n80\/tcp &nbsp; open&nbsp; http\n443\/tcp&nbsp; open&nbsp; https<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7aef\u53e3<\/strong>\uff1a\u7aef\u53e3\u53f7\u548c\u534f\u8bae\uff08TCP \u6216 UDP\uff09\u3002<\/li>\n\n\n\n<li><strong>\u72b6\u6001<\/strong>\uff1a\u544a\u8bc9\u4f60\u7aef\u53e3\u662f\u6253\u5f00\u7684\u3001\u5173\u95ed\u7684\u8fd8\u662f\u88ab\u8fc7\u6ee4\u7684\uff08\u88ab\u9632\u706b\u5899\u963b\u6b62\u7684\uff09\u3002<\/li>\n\n\n\n<li><strong>\u670d\u52a1<\/strong>\uff1a\u4f7f\u7528\u8be5\u7aef\u53e3\u7684\u670d\u52a1\u7684\u901a\u7528\u540d\u79f0\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>nmap \u7684\u7528\u9014\uff1a<\/strong><\/p>\n\n\n\n<p><strong><\/strong>\u5982\u679c\u4f60\u60f3\u5168\u9762\u4e86\u89e3\u7cfb\u7edf\u4e0a\u6240\u6709\u5f00\u653e\u7684\u7aef\u53e3\uff0c\u6216\u8005\u9700\u8981\u626b\u63cf\u53e6\u4e00\u53f0\u673a\u5668\uff0c<strong>nmap\u662f\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u4f7f\u7528 nc\uff08Netcat\uff09<\/h3>\n\n\n\n<p><strong>Netcat<\/strong>\u662f\u4e00\u4e2a\u7b80\u5355\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u68c0\u67e5\u7279\u5b9a\u7aef\u53e3\u662f\u5426\u6253\u5f00\u3002<\/p>\n\n\n\n<p><strong>\u8981\u68c0\u67e5\u7aef\u53e3 22 \u662f\u5426\u5f00\u653e\uff0c\u8bf7\u952e\u5165\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nc&nbsp;-zv&nbsp;localhost&nbsp;22<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>-z<\/strong>\uff1a\u4ec5\u626b\u63cf\u5f00\u653e\u7aef\u53e3\uff0c\u4e0d\u53d1\u9001\u6570\u636e\u3002<\/li>\n\n\n\n<li><strong>-v<\/strong>\uff1a\u663e\u793a\u8be6\u7ec6\u8f93\u51fa\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u60a8\u5c06\u770b\u5230\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Connection&nbsp;to&nbsp;localhost&nbsp;22&nbsp;port&nbsp;&#91;tcp\/ssh]&nbsp;succeeded!\n<\/code><\/pre>\n\n\n\n<p><strong>\u5b83\u7684\u4f18\u52bf\uff1a<\/strong><\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u53ea\u9700\u8981\u5feb\u901f\u68c0\u67e5\u67d0\u4e2a\u7279\u5b9a\u7aef\u53e3\u662f\u5426\u6253\u5f00\uff0c<strong>nc<\/strong>\u53ef\u4ee5\u8f7b\u677e\u5b8c\u6210\u8fd9\u9879\u5de5\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u8bfb\u7ed3\u679c<\/h2>\n\n\n\n<p>\u68c0\u67e5\u7aef\u53e3\u65f6\uff0c\u7ed3\u679c\u901a\u5e38\u610f\u5473\u7740\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u76d1\u542c\/\u5f00\u653e\u7aef\u53e3\uff1a<\/strong>\u8fd9\u4e9b\u7aef\u53e3\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u3002\u4f8b\u5982\uff0cWeb <a href=\"https:\/\/www.ldhost.cn\/cloudhost.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u670d\u52a1\u5668<\/a>\u4f1a\u76d1\u542c 80 \u7aef\u53e3\u6216 443 \u7aef\u53e3\u3002<\/li>\n\n\n\n<li><strong>\u5173\u95ed\u7684\u7aef\u53e3\uff1a<\/strong>\u8fd9\u4e9b\u7aef\u53e3\u672a\u4f7f\u7528\uff0c\u56e0\u6b64\u4e0d\u4f1a\u63a5\u53d7\u8fde\u63a5\u3002<\/li>\n\n\n\n<li><strong>\u5df2\u8fc7\u6ee4\u7aef\u53e3\uff1a<\/strong>\u8fd9\u4e9b\u7aef\u53e3\u88ab\u9632\u706b\u5899\u6216\u5b89\u5168\u89c4\u5219\u963b\u6b62\uff0c\u56e0\u6b64\u5b83\u4eec\u770b\u8d77\u6765\u662f\u4e0d\u53ef\u89c1\u7684\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u5e38\u89c1\u573a\u666f<\/h4>\n\n\n\n<p>\u68c0\u67e5\u7aef\u53e3\u65f6\uff0c\u60a8\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u60c5\u51b5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5982\u679c\u60a8\u53d1\u73b0\u67d0\u4e2a\u7aef\u53e3\u5904\u4e8e\u6253\u5f00\u72b6\u6001\uff0c\u800c\u60a8\u5e76\u672a\u9884\u6599\u5230\uff0c<\/strong>\u8fd9\u53ef\u80fd\u610f\u5473\u7740\u67d0\u4e2a\u60a8\u4e0d\u9700\u8981\u6216\u4e0d\u8ba4\u8bc6\u7684\u7a0b\u5e8f\u6b63\u5728\u8fd0\u884c\u3002\u6700\u597d\u8fdb\u4e00\u6b65\u8c03\u67e5\u4e00\u4e0b\u3002<\/li>\n\n\n\n<li><strong>\u60a8\u9700\u8981\u7684\u7aef\u53e3\u5df2\u5173\u95ed\uff1a<\/strong>\u7a0b\u5e8f\u53ef\u80fd\u672a\u8fd0\u884c\uff0c\u6216\u8005\u9632\u706b\u5899\u53ef\u80fd\u963b\u6b62\u4e86\u5b83\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4fdd\u62a4\u60a8\u7684\u7cfb\u7edf<\/h2>\n\n\n\n<p>\u68c0\u67e5\u7aef\u53e3\u53ea\u662f\u7b2c\u4e00\u6b65\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6574\u7406\u7aef\u53e3\u7684\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p><strong>\u505c\u6b62\u4e0d\u5fc5\u8981\u7684\u7a0b\u5e8f\uff1a<\/strong><br>\u5982\u679c\u67d0\u4e2a\u7a0b\u5e8f\u6b63\u5728\u4f60\u4e0d\u9700\u8981\u7684\u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u8bf7\u5c06\u5176\u5173\u95ed\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop &lt;program_name&gt;\nsudo systemctl disable &lt;program_name&gt;<\/code><\/pre>\n\n\n\n<p><strong>\u4f7f\u7528\u9632\u706b\u5899\uff1a<\/strong><br>\u4f7f\u7528\u50cf ufw\uff08\u7b80\u6613\u9632\u706b\u5899\uff09\u8fd9\u6837\u7684\u5de5\u5177\u9650\u5236\u5bf9\u7aef\u53e3\u7684\u8bbf\u95ee\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 22 &nbsp; &nbsp; # Allow SSH&nbsp;&nbsp;\nsudo ufw deny 80&nbsp; &nbsp; &nbsp; # Block HTTP<\/code><\/pre>\n\n\n\n<p><strong>\u5b9a\u671f\u76d1\u63a7\u7aef\u53e3\uff1a<\/strong><br>\u517b\u6210\u5b9a\u671f\u68c0\u67e5\u5f00\u653e\u7aef\u53e3\u7684\u4e60\u60ef\uff0c\u5c24\u5176\u662f\u5728\u8fd0\u884c<a href=\"https:\/\/www.ldhost.cn\/hkserver.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u670d\u52a1\u5668<\/a>\u65f6\u3002<\/p>\n\n\n\n<p>\u5728 Linux \u7cfb\u7edf\u4e2d\u68c0\u67e5\u7aef\u53e3\u5e76\u4e0d\u590d\u6742\u3002\u65e0\u8bba\u4f60\u4f7f\u7528 netstat\u3001ss\u3001lsof\u3001nmap \u8fd8\u662f nc\uff0c\u6bcf\u4e2a\u5de5\u5177\u90fd\u80fd\u63d0\u4f9b\u7565\u6709\u4e0d\u540c\u7684\u4fe1\u606f\u3002\u9009\u62e9\u6700\u9002\u5408\u4f60\u9700\u6c42\u7684\u5de5\u5177\uff0c\u5e76\u5927\u80c6\u63a2\u7d22\u3002\u719f\u80fd\u751f\u5de7\uff01<\/p>\n\n\n\n<p><\/p>\n<div><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/images\/ad-845-3.png\" alt=\"\u56fe\u7247\u63cf\u8ff0\" \/><\/div>","protected":false},"excerpt":{"rendered":"<p>\u7aef\u53e3\u5c31\u50cf\u95e8\u4e00\u6837\uff0c\u5141\u8bb8 Linux \u7cfb\u7edf\u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u7a0b\u5e8f\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\u3002\u5982\u679c\u60a8\u60f3\u67e5\u770b\u54ea\u4e9b\u7aef\u53e3\u6b63\u5728\u4f7f\u7528\u3001\u54ea\u4e9b\u7aef\u53e3\u5904\u4e8e\u5f00\u653e\u72b6\u6001\u3002 \u4ec0\u4e48\u662f\u7aef\u53e3\uff1f \u5728\u6df1\u5165\u4e86\u89e3\u547d\u4ee4\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u82b1\u70b9\u65f6\u95f4\u4e86\u89e3\u4e00\u4e0b\u4ec0\u4e48\u662f\u7aef\u53e3\uff1a \u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u4e4b\u540e\uff0c\u6211\u4eec\u6765\u5982\u4f55\u68c0\u67e5\u7aef\u53e3\u7684\u8fd0\u884c\u72b6\u51b5\u3002 \u5982\u4f55\u5728Linux\u4e2d\u68c0\u67e5\u7aef\u53e3 Linux \u63d0\u4f9b\u4e86\u8bb8\u591a\u5de5\u5177\u6765\u5e2e\u52a9\u60a8\u68c0\u67e5\u5f00\u653e\u6216\u76d1\u542c\u7684\u7aef\u53e3\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u4e94\u79cd\u5e38\u7528\u65b9\u6cd5\uff0c\u5e76\u89e3\u91ca\u6bcf\u79cd\u65b9\u6cd5\u7684\u4f5c\u7528\u3002 1. \u4f7f\u7528 netstat netstat \u547d\u4ee4\u53ef\u4ee5\u8be6\u7ec6\u663e\u793a\u7f51\u7edc\u8fde\u63a5\u548c\u7aef\u53e3\u4f7f\u7528\u60c5\u51b5\u3002 \u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165\uff1a \u4ee5\u4e0b\u662f\u6bcf\u4e2a\u9009\u9879\u7684\u542b\u4e49\uff1a \u60a8\u5c06\u770b\u5230\uff1a \u4ee5\u4e0b\u662f\u9605\u8bfb\u672c\u6587\u7684\u65b9\u6cd5\uff1a \u7b80\u8981\u8bf4\u660e\uff1a&nbsp;netstat \u662f net-&#8230; <a href=\"https:\/\/www.ldhost.cn\/jc\/linux\/13582.html\" class=\"readmore\">\u9605\u8bfb\u5168\u6587<span class=\"screen-reader-text\">5 \u79cd\u68c0\u67e5 Linux \u7cfb\u7edf\u5df2\u5f00\u653e\u7aef\u53e3\u7684\u65b9\u6cd5<\/span><span class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96],"tags":[],"class_list":["post-13582","post","type-post","status-publish","format-standard","hentry","category-linux","content-layout-excerpt-thumb"],"_links":{"self":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/comments?post=13582"}],"version-history":[{"count":2,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13582\/revisions"}],"predecessor-version":[{"id":13585,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13582\/revisions\/13585"}],"wp:attachment":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/media?parent=13582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/categories?post=13582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/tags?post=13582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}