{"id":63664,"date":"2025-04-29T08:20:19","date_gmt":"2025-04-29T00:20:19","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63664\/"},"modified":"2025-04-29T08:20:19","modified_gmt":"2025-04-29T00:20:19","slug":"linux%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8bssh%e7%ab%af%e5%8f%a3-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63664\/","title":{"rendered":"linux\u600e\u4e48\u67e5\u770bssh\u7aef\u53e3"},"content":{"rendered":"<blockquote><p>\n  \u8981\u67e5\u770b linux ssh \u7aef\u53e3\uff0c\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u6253\u5f00 ssh \u914d\u7f6e\u6587\u4ef6 (\/etc\/ssh\/sshd_config) \u5e76\u627e\u5230 &#8220;port&#8221; \u884c\u3002\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c &#8220;sudo netstat -tulpn | grep ssh&#8221;\uff0cssh \u7aef\u53e3\u53f7\u5c06\u663e\u793a\u5728\u7ed3\u679c\u4e2d\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/04\/2024060410151729219.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770bssh\u7aef\u53e3\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u67e5\u770bssh\u7aef\u53e3\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b Linux SSH \u7aef\u53e3\uff1f<\/strong><\/p>\n<p>\u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u67e5\u770b SSH \u7aef\u53e3\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p><strong>\u65b9\u6cd5 1\uff1a\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<ol>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00 SSH \u914d\u7f6e\u6587\u4ef6 \/etc\/ssh\/sshd_config\u3002<\/li>\n<li>\u627e\u5230\u5982\u4e0b\u884c\uff1a<\/li>\n<\/ol>\n<pre>Port &lt;port_number&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d \u8868\u793a SSH \u7aef\u53e3\u53f7\u3002 <\/p>\n<p><strong>\u65b9\u6cd5 2\uff1a\u901a\u8fc7\u547d\u4ee4\u884c<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u7a97\u53e3\u3002<\/li>\n<li>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>sudo netstat -tulpn | grep ssh<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8f93\u51fa\u6240\u6709\u6b63\u5728\u76d1\u542c TCP \u7aef\u53e3\uff08\u5305\u62ec SSH\uff09\u7684\u8fdb\u7a0b\u3002\u627e\u5230\u5177\u6709\u76f8\u5e94\u7aef\u53e3\u53f7\u7684\u884c\uff0c\u5373\u53ef\u67e5\u770b SSH \u7aef\u53e3\u3002<\/p>\n<p><strong>\u793a\u4f8b\u8f93\u51fa\uff1a<\/strong><\/p>\n<pre>tcp6       0      0 :::22                 :::*                  LISTEN      424\/sshd<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u8be5\u793a\u4f8b\u4e2d\uff0cSSH \u7aef\u53e3\u53f7\u4e3a 22\u3002<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>SSH \u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7\u662f 22\u3002<\/li>\n<li>\u5982\u679c SSH \u7aef\u53e3\u53f7\u5df2\u66f4\u6539\uff0c\u5219\u9700\u8981\u5728 SSH \u5ba2\u6237\u7aef\u4e2d\u6307\u5b9a\u5b83\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770bssh\u7aef\u53e3\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u67e5\u770b linux ssh \u7aef\u53e3\uff0c\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u6253\u5f00 ssh \u914d\u7f6e\u6587\u4ef6 (\/etc\/ssh\/sshd_config) \u5e76\u627e\u5230 &#8220;port&#8221; \u884c\u3002\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c &#8220;sudo netstat -tulpn | grep ssh&#8221;\uff0cssh \u7aef\u53e3\u53f7\u5c06\u663e\u793a\u5728\u7ed3\u679c\u4e2d\u3002 \u5982\u4f55\u67e5\u770b Linux SSH \u7aef\u53e3\uff1f \u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u67e5\u770b SSH \u7aef\u53e3\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a \u65b9\u6cd5 1\uff1a\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6 \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00 SSH \u914d\u7f6e\u6587\u4ef6 \/etc\/ssh\/sshd_config\u3002 \u627e\u5230\u5982\u4e0b\u884c\uff1a Port &lt;port_number&gt; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d \u8868\u793a SSH \u7aef\u53e3\u53f7\u3002 \u65b9\u6cd5 2\uff1a\u901a\u8fc7\u547d\u4ee4\u884c \u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u7a97\u53e3\u3002 \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo netstat -tulpn | grep ssh \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u8f93\u51fa\u6240\u6709\u6b63\u5728\u76d1\u542c TCP \u7aef\u53e3\uff08\u5305\u62ec SSH\uff09\u7684\u8fdb\u7a0b\u3002\u627e\u5230\u5177\u6709\u76f8\u5e94\u7aef\u53e3\u53f7\u7684\u884c\uff0c\u5373\u53ef\u67e5\u770b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63664","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63664"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63664\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}