<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://md5.pw/index.php?action=history&amp;feed=atom&amp;title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D%2F%E8%B6%85%E6%97%B6%2F%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89</id>
	<title>SSH连接故障排除指南（拒绝/超时/密钥及常见修复） - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://md5.pw/index.php?action=history&amp;feed=atom&amp;title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D%2F%E8%B6%85%E6%97%B6%2F%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89"/>
	<link rel="alternate" type="text/html" href="https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;action=history"/>
	<updated>2026-05-03T13:40:03Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1658&amp;oldid=prev</id>
		<title>2026年3月19日 (四) 17:38 Liam</title>
		<link rel="alternate" type="text/html" href="https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1658&amp;oldid=prev"/>
		<updated>2026-03-19T17:38:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年3月19日 (四) 10:38的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l184&quot;&gt;第184行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第184行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 结语与下一步行动 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 结语与下一步行动 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SSH 故障排查是一个建立排错逻辑的绝佳过程。当你能够熟练地从网络层、服务层、认证层逐一剥丝抽茧定位问题时，你就不再是一个只会复制粘贴命令的新手，而是初步具备了独立解决问题的架构师思维。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SSH 故障排查是一个建立排错逻辑的绝佳过程。当你能够熟练地从网络层、服务层、认证层逐一剥丝抽茧定位问题时，你就不再是一个只会复制粘贴命令的新手，而是初步具备了独立解决问题的架构师思维。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:500 常见应用指南 — Application Guides]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-1657:rev-1658:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Liam</name></author>
	</entry>
	<entry>
		<id>https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1657&amp;oldid=prev</id>
		<title>Sky：​SSH连接故障排除指南（拒绝/超时/密钥及常见修复）</title>
		<link rel="alternate" type="text/html" href="https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1657&amp;oldid=prev"/>
		<updated>2026-03-19T07:45:49Z</updated>

		<summary type="html">&lt;p&gt;SSH连接故障排除指南（拒绝/超时/密钥及常见修复）&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年3月19日 (四) 00:45的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;相信很多人在第一次使&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;用shell&lt;/del&gt;软件登录自己新购买的服务器湖或者在部署什么服务时，不小心点了什么操作导致了SSH无法连接成功。这时候，可能会出现不同的报错情况，新手小白可能会不知所措。说实话，我也曾经遇到过这种情况，也曾经因为这种情况消磨了我对鼓捣服务器的热情。后面也是自己找了很多资料，才大体搞清了具体的问题所在，以及如何去解决对应的问题。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;相信很多人在第一次使&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;用Shell&lt;/ins&gt;软件登录自己新购买的服务器湖或者在部署什么服务时，不小心点了什么操作导致了SSH无法连接成功。这时候，可能会出现不同的报错情况，新手小白可能会不知所措。说实话，我也曾经遇到过这种情况，也曾经因为这种情况消磨了我对鼓捣服务器的热情。后面也是自己找了很多资料，才大体搞清了具体的问题所在，以及如何去解决对应的问题。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这篇文章我会带大家针对VPS日常使用中最常见的SSH故障，提供从问题分析到如何解决的排查指南。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这篇文章我会带大家针对VPS日常使用中最常见的SSH故障，提供从问题分析到如何解决的排查指南。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;第6行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第6行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 一、 快速诊断：你遇到的是哪种情况？ ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 一、 快速诊断：你遇到的是哪种情况？ ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在动手敲代码之前，我们需要先&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;“望闻问切”&lt;/del&gt;。SSH报错通常分为三大流派，它们代表了网络通信中完全不同的三个失败阶段。请对照下表，定位你的问题属于哪一类：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在动手敲代码之前，我们需要先&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;看Shell输出了什么错误内容&lt;/ins&gt;。SSH报错通常分为三大流派，它们代表了网络通信中完全不同的三个失败阶段。请对照下表，定位你的问题属于哪一类：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!报错提示 (终端输出)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!报错提示 (终端输出)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;第37行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第37行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 二、 深度排查 1：Connection timed out (连接超时) ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 二、 深度排查 1：Connection timed out &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/ Connection failed &lt;/ins&gt;(连接超时&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/失败&lt;/ins&gt;) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“连接超时”是最让人头疼的报错，因为它的原因往往游离在服务器系统之外。它意味着你发送的TCP连接请求（SYN报文）如同泥牛入海，没有收到任何回应。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“连接超时”是最让人头疼的报错，因为它的原因往往游离在服务器系统之外。它意味着你发送的TCP连接请求（SYN报文）如同泥牛入海，没有收到任何回应。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh1.png|center|thumb|914x914px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 1. 检查服务器是否“活着” (宕机排查) ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 1. 检查服务器是否“活着” (宕机排查) ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot;&gt;第57行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第58行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 3. 检查系统级防火墙是否拦截了 SSH 端口 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 3. 检查系统级防火墙是否拦截了 SSH 端口 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如果你在&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;上次&lt;/del&gt;登录时安装了 &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; 或修改了 &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; 规则，但忘记放行 SSH 端口就启用了防火墙，那么你就会把自己“锁在门外”。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如果你在&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;之前&lt;/ins&gt;登录时安装了 &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; 或修改了 &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; 规则，但忘记放行 SSH 端口就启用了防火墙，那么你就会把自己“锁在门外”。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 行动： 此时你无法通过 SSH 登录，必须使用服务商提供的 VNC Console (网页版控制台) 或 Serial Console (串行控制台)。以 KiwiVM 面板为例，找到 &amp;lt;code&amp;gt;Root shell - interactive&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;VNC&amp;lt;/code&amp;gt; 选项进入系统。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 行动： 此时你无法通过 SSH 登录，必须使用服务商提供的 VNC Console (网页版控制台) 或 Serial Console (串行控制台)。以 KiwiVM 面板为例，找到 &amp;lt;code&amp;gt;Root shell - interactive&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;VNC&amp;lt;/code&amp;gt; 选项进入系统。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l63&quot;&gt;第63行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第64行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw status&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw status&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;如果你发现列表中没有允许 &amp;lt;code&amp;gt;22/tcp&amp;lt;/code&amp;gt; (或你自定义的 SSH 端口)，请立即放行：&amp;lt;syntaxhighlight lang=&quot;bash&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh2.png|center|thumb|898x898px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;如果你发现列表中没有允许 &amp;lt;code&amp;gt;22/tcp&amp;lt;/code&amp;gt; (或你自定义的 SSH 端口)，请立即放行：&amp;lt;syntaxhighlight lang=&quot;bash&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw allow 22/tcp&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw allow 22/tcp&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw reload&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ufw reload&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l79&quot;&gt;第79行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第82行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 1. 端口号输错了 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 1. 端口号输错了 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这是新手最容易犯的低级错误。你可能出于安全考虑，在 &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt; 中把 SSH 端口从 &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; 改成了 &amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;28492&lt;/del&gt;&amp;lt;/code&amp;gt;，但在登录时却忘了指定新端口，使用的依然是默认端口。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这是新手最容易犯的低级错误。你可能出于安全考虑，在 &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt; 中把 SSH 端口从 &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; 改成了 &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;28482&lt;/ins&gt;&amp;lt;/code&amp;gt;，但在登录时却忘了指定新端口，使用的依然是默认端口。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh3.png|center|thumb|951x951px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 错误示范：&amp;lt;code&amp;gt;ssh root@198.51.100.1&amp;lt;/code&amp;gt; (默认连接 22 端口，被拒绝)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 错误示范：&amp;lt;code&amp;gt;ssh root@198.51.100.1&amp;lt;/code&amp;gt; (默认连接 22 端口，被拒绝)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 正确写法：&amp;lt;code&amp;gt;ssh -p &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;28492 &lt;/del&gt;root@198.51.100.1&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 正确写法：&amp;lt;code&amp;gt;ssh -p &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;28482 &lt;/ins&gt;root@198.51.100.1&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 2. SSH 服务 (sshd) 崩溃或未随系统启动 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 2. SSH 服务 (sshd) 崩溃或未随系统启动 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot;&gt;第93行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第97行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;或者在 Debian/Ubuntu 系统上：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;或者在 Debian/Ubuntu 系统上：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;systemctl status ssh&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;systemctl status ssh&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;急救：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh5.png|center|thumb|951x951px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;急救：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如果状态显示为 &amp;lt;code&amp;gt;inactive (dead)&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;failed&amp;lt;/code&amp;gt;，尝试手动启动它：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如果状态显示为 &amp;lt;code&amp;gt;inactive (dead)&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;failed&amp;lt;/code&amp;gt;，尝试手动启动它：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot;&gt;第99行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第105行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;为了防止下次重启再次失效，设置其开机自启：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;为了防止下次重启再次失效，设置其开机自启：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  systemctl enable sshd&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  systemctl enable sshd&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh4.png|center|thumb|951x951px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 3. 配置文件语法错误导致服务启动失败 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 3. 配置文件语法错误导致服务启动失败 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l104&quot;&gt;第104行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第111行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 诊断： 在 VNC 中执行启动命令时，如果提示失败，可以查看详细的系统日志：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 诊断： 在 VNC 中执行启动命令时，如果提示失败，可以查看详细的系统日志：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;bash&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;bash&quot;&amp;gt;journalctl -xeu sshd.service&amp;lt;/syntaxhighlight&amp;gt;或者让 sshd 帮我们检查配置文件的语法错误：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;journalctl -xeu sshd.service&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;或者让 sshd 帮我们检查配置文件的语法错误：&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;#039;&amp;#039;&amp;#039;sshd -t&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;#039;&amp;#039;&amp;#039;sshd -t&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l121&quot;&gt;第121行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第126行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 修复： 不要怀疑自己，直接去 VPS 控制面板（KiwiVM）寻找 Root password modification 或 Reset Root Password 选项。点击重置后，系统会强制修改密码并重启 VPS。用新生成的密码重新登录即可。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 修复： 不要怀疑自己，直接去 VPS 控制面板（KiwiVM）寻找 Root password modification 或 Reset Root Password 选项。点击重置后，系统会强制修改密码并重启 VPS。用新生成的密码重新登录即可。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Ssh6.png|center|thumb|945x945px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 2. 密钥认证失败：~/.ssh 目录权限“洁癖” ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 2. 密钥认证失败：~/.ssh 目录权限“洁癖” ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sky</name></author>
	</entry>
	<entry>
		<id>https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1649&amp;oldid=prev</id>
		<title>Sky：​SSH连接故障排除指南（拒绝/超时/密钥及常见修复）【未完成】</title>
		<link rel="alternate" type="text/html" href="https://md5.pw/index.php?title=SSH%E8%BF%9E%E6%8E%A5%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4%E6%8C%87%E5%8D%97%EF%BC%88%E6%8B%92%E7%BB%9D/%E8%B6%85%E6%97%B6/%E5%AF%86%E9%92%A5%E5%8F%8A%E5%B8%B8%E8%A7%81%E4%BF%AE%E5%A4%8D%EF%BC%89&amp;diff=1649&amp;oldid=prev"/>
		<updated>2026-03-18T15:07:12Z</updated>

		<summary type="html">&lt;p&gt;SSH连接故障排除指南（拒绝/超时/密钥及常见修复）【未完成】&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
相信很多人在第一次使用shell软件登录自己新购买的服务器湖或者在部署什么服务时，不小心点了什么操作导致了SSH无法连接成功。这时候，可能会出现不同的报错情况，新手小白可能会不知所措。说实话，我也曾经遇到过这种情况，也曾经因为这种情况消磨了我对鼓捣服务器的热情。后面也是自己找了很多资料，才大体搞清了具体的问题所在，以及如何去解决对应的问题。&lt;br /&gt;
&lt;br /&gt;
这篇文章我会带大家针对VPS日常使用中最常见的SSH故障，提供从问题分析到如何解决的排查指南。&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 一、 快速诊断：你遇到的是哪种情况？ ==&lt;br /&gt;
在动手敲代码之前，我们需要先“望闻问切”。SSH报错通常分为三大流派，它们代表了网络通信中完全不同的三个失败阶段。请对照下表，定位你的问题属于哪一类：&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!报错提示 (终端输出)&lt;br /&gt;
!中文直译&lt;br /&gt;
!故障发生的阶段&lt;br /&gt;
!核心原因概括&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Connection timed out&amp;lt;/code&amp;gt;&lt;br /&gt;
|连接超时&lt;br /&gt;
|网络层 / 路由层&lt;br /&gt;
|数据包在半路走丢了，或者被服务器的防火墙直接丢弃。服务器根本没收到你的“敲门声”。&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Connection refused&amp;lt;/code&amp;gt;&lt;br /&gt;
|拒绝连接&lt;br /&gt;
|服务层 / 端口层&lt;br /&gt;
|数据包成功到达了服务器，但服务器告诉你：“这个端口没有SSH服务在运行”。&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Permission denied&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Authentication failed&amp;lt;/code&amp;gt;&lt;br /&gt;
|权限被拒绝&lt;br /&gt;
身份验证失败&lt;br /&gt;
|认证层 / 密钥层&lt;br /&gt;
|你成功敲开了门，但服务器不认识你（密码错误、密钥不匹配、权限配置错乱）。&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Host key verification failed&amp;lt;/code&amp;gt;&lt;br /&gt;
|主机密钥验证失败&lt;br /&gt;
|客户端安全层&lt;br /&gt;
|你的本地电脑发现这台服务器的“指纹”变了（通常发生在VPS重装系统之后），出于安全保护拒绝连接。&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 二、 深度排查 1：Connection timed out (连接超时) ==&lt;br /&gt;
“连接超时”是最让人头疼的报错，因为它的原因往往游离在服务器系统之外。它意味着你发送的TCP连接请求（SYN报文）如同泥牛入海，没有收到任何回应。&lt;br /&gt;
&lt;br /&gt;
== 1. 检查服务器是否“活着” (宕机排查) ==&lt;br /&gt;
很多时候，超时仅仅是因为VPS关机了或者宿主机（母机）正在维护。&lt;br /&gt;
&lt;br /&gt;
* 行动： 登录你的VPS控制面板（例如 KiwiVM 面板）。&lt;br /&gt;
* 查看状态： 确认服务器的状态是否显示为 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt;（运行中）。&lt;br /&gt;
* 急救： 如果状态是 &amp;lt;code&amp;gt;Stopped&amp;lt;/code&amp;gt;，点击 &amp;lt;code&amp;gt;Start&amp;lt;/code&amp;gt; 开机。如果显示 &amp;lt;code&amp;gt;Running&amp;lt;/code&amp;gt; 但依然超时，尝试点击 &amp;lt;code&amp;gt;Hard Reset&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;Force Restart&amp;lt;/code&amp;gt; 进行强制重启。&lt;br /&gt;
&lt;br /&gt;
== 2. 检查 IP 是否被网络防火墙阻断 (IP 被墙) ==&lt;br /&gt;
如果你的VPS位于海外，这是最常见的超时原因。本地运营商或主干网防火墙可能拦截了发往该IP的数据包。&lt;br /&gt;
&lt;br /&gt;
* 行动： 使用多节点 Ping 测试工具（强烈推荐访问 &amp;lt;code&amp;gt;ping.pe&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;itdog.cn&amp;lt;/code&amp;gt;）。&lt;br /&gt;
* 诊断： 在工具中输入你的 VPS IP 地址。&lt;br /&gt;
** 如果 海外节点全绿，国内节点全红：确诊你的 IP 已被国内网络防火墙阻断（被墙）。&lt;br /&gt;
** 如果 全球节点全红：说明服务器处于宕机状态，或者服务器内部的防火墙拦截了所有 ICMP (Ping) 请求。&lt;br /&gt;
* 急救： 如果 IP 被墙，如果是动态 IP 服务商可以尝试重新获取 IP；如果是固定 IP 服务商，通常需要购买更换 IP 的服务，或者通过其他海外节点进行中转跳板连接。&lt;br /&gt;
&lt;br /&gt;
== 3. 检查系统级防火墙是否拦截了 SSH 端口 ==&lt;br /&gt;
如果你在上次登录时安装了 &amp;lt;code&amp;gt;ufw&amp;lt;/code&amp;gt; 或修改了 &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; 规则，但忘记放行 SSH 端口就启用了防火墙，那么你就会把自己“锁在门外”。&lt;br /&gt;
&lt;br /&gt;
* 行动： 此时你无法通过 SSH 登录，必须使用服务商提供的 VNC Console (网页版控制台) 或 Serial Console (串行控制台)。以 KiwiVM 面板为例，找到 &amp;lt;code&amp;gt;Root shell - interactive&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;VNC&amp;lt;/code&amp;gt; 选项进入系统。&lt;br /&gt;
* 诊断与修复 (以 UFW 为例)：  在 VNC 的黑框中登录 Root 账户，输入以下命令查看防火墙状态：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ufw status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;如果你发现列表中没有允许 &amp;lt;code&amp;gt;22/tcp&amp;lt;/code&amp;gt; (或你自定义的 SSH 端口)，请立即放行：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ufw allow 22/tcp&lt;br /&gt;
ufw reload&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;如果是 &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; 把你锁住了，可以通过以下命令紧急清空规则（注意：这会暴露所有端口，仅作紧急救援使用）：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -F&lt;br /&gt;
iptables -X&lt;br /&gt;
iptables -P INPUT ACCEPT&lt;br /&gt;
iptables -P OUTPUT ACCEPT&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 三、 深度排查 2：Connection refused (拒绝连接) ==&lt;br /&gt;
当你看到“拒绝连接”时，其实应该松一口气。这说明网络是畅通的，IP 没有被墙，数据包成功抵达了目标机器。只是目标机器的操作系统直接返回了一个 &amp;lt;code&amp;gt;RST&amp;lt;/code&amp;gt; (复位) 数据包，无情地关上了门。&lt;br /&gt;
&lt;br /&gt;
== 1. 端口号输错了 ==&lt;br /&gt;
这是新手最容易犯的低级错误。你可能出于安全考虑，在 &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt; 中把 SSH 端口从 &amp;lt;code&amp;gt;22&amp;lt;/code&amp;gt; 改成了 &amp;lt;code&amp;gt;28492&amp;lt;/code&amp;gt;，但在登录时却忘了指定新端口，使用的依然是默认端口。&lt;br /&gt;
&lt;br /&gt;
* 错误示范：&amp;lt;code&amp;gt;ssh root@198.51.100.1&amp;lt;/code&amp;gt; (默认连接 22 端口，被拒绝)&lt;br /&gt;
* 正确写法：&amp;lt;code&amp;gt;ssh -p 28492 root@198.51.100.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2. SSH 服务 (sshd) 崩溃或未随系统启动 ==&lt;br /&gt;
如果是你重装了系统或者强制重启后出现此问题，极有可能是 SSH 守护进程（sshd）没有正常运行。&lt;br /&gt;
&lt;br /&gt;
* 行动： 同样需要登录控制面板的 VNC Console。&lt;br /&gt;
* 诊断： 检查 SSH 服务的运行状态：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status sshd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;或者在 Debian/Ubuntu 系统上：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status ssh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;急救：&lt;br /&gt;
&lt;br /&gt;
如果状态显示为 &amp;lt;code&amp;gt;inactive (dead)&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;failed&amp;lt;/code&amp;gt;，尝试手动启动它：&lt;br /&gt;
 systemctl start sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
为了防止下次重启再次失效，设置其开机自启：&lt;br /&gt;
 systemctl enable sshd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. 配置文件语法错误导致服务启动失败 ==&lt;br /&gt;
如果你刚修改过 &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt; 文件（比如修改端口、禁用密码登录等），不小心多打了一个字母，保存并重启系统后，sshd 服务会因为语法错误而彻底罢工。&lt;br /&gt;
&lt;br /&gt;
* 诊断： 在 VNC 中执行启动命令时，如果提示失败，可以查看详细的系统日志：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
journalctl -xeu sshd.service&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;或者让 sshd 帮我们检查配置文件的语法错误：&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;sshd -t&amp;#039;&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* 如果配置有错，系统会精准地告诉你哪一行写错了（例如：&amp;lt;code&amp;gt;line 15: Bad configuration option&amp;lt;/code&amp;gt;）。&lt;br /&gt;
* 修复： 使用 &amp;lt;code&amp;gt;nano /etc/ssh/sshd_config&amp;lt;/code&amp;gt; 进去把那一行的拼写错误改回来，然后再次 &amp;lt;code&amp;gt;systemctl start sshd&amp;lt;/code&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 四、 深度排查 3：Permission denied / 密钥错误 (权限被拒绝) ==&lt;br /&gt;
走到这一步，说明网络通畅，SSH服务也在正常运转，但这台服务器的“保安”觉得你身份可疑，不让你进。&lt;br /&gt;
&lt;br /&gt;
== 1. Root 密码真的输错了 ==&lt;br /&gt;
人的记忆是不可靠的。特别是很多服务商在开通 VPS 时，会随机生成一串诸如 &amp;lt;code&amp;gt;a8F!k9Lz@&amp;lt;/code&amp;gt; 这样反人类的初始密码。&lt;br /&gt;
&lt;br /&gt;
* 修复： 不要怀疑自己，直接去 VPS 控制面板（KiwiVM）寻找 Root password modification 或 Reset Root Password 选项。点击重置后，系统会强制修改密码并重启 VPS。用新生成的密码重新登录即可。&lt;br /&gt;
&lt;br /&gt;
== 2. 密钥认证失败：~/.ssh 目录权限“洁癖” ==&lt;br /&gt;
如果你配置了更加安全的 SSH Key (密钥对) 登录，但依然提示 &amp;lt;code&amp;gt;Permission denied (publickey)&amp;lt;/code&amp;gt;，90% 的概率是因为 Linux 对密钥文件的权限要求有着极其变态的“洁癖”。&lt;br /&gt;
&lt;br /&gt;
如果别人能随意读取或修改你的密钥文件，那么密钥登录就失去了意义。因此，如果你的 &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; 目录或 &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; 文件的权限设置过宽，SSH 服务会直接拒绝读取它们。&lt;br /&gt;
&lt;br /&gt;
* 行动： 通过 VNC 控制台登录（或使用密码登录，如果你还没禁用密码的话）。&lt;br /&gt;
* 修复核心权限： 严格执行以下权限锁定命令：&lt;br /&gt;
&lt;br /&gt;
 # 设定当前用户根目录的权限 (不能开放给所有用户组写入)&lt;br /&gt;
 chmod 750 ~&lt;br /&gt;
 &lt;br /&gt;
 # 设定 .ssh 文件夹的权限：仅所有者可读写执行 (rwx------)&lt;br /&gt;
 chmod 700 ~/.ssh&lt;br /&gt;
 &lt;br /&gt;
 # 设定公钥记录文件的权限：仅所有者可读写 (rw-------)&lt;br /&gt;
 chmod 600 ~/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
修复权限后，通常无需重启 sshd，直接在本地重新尝试连接即可。&lt;br /&gt;
&lt;br /&gt;
== 3. 公钥粘贴格式错误 ==&lt;br /&gt;
在将本地的 &amp;lt;code&amp;gt;.pub&amp;lt;/code&amp;gt; 公钥内容复制到 VPS 的 &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; 文件时，不小心在中间多加了一个换行符，或者复制漏了最后一个字符，都会导致指纹无法匹配。&lt;br /&gt;
&lt;br /&gt;
* 修复： 在 VNC 中使用 &amp;lt;code&amp;gt;cat ~/.ssh/authorized_keys&amp;lt;/code&amp;gt; 查看。正常情况下，一个公钥必须完完整整地占据单独的一行（通常以 &amp;lt;code&amp;gt;ssh-rsa&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;ssh-ed25519&amp;lt;/code&amp;gt; 开头，以你的电脑用户名结尾）。如果断行了，使用 &amp;lt;code&amp;gt;nano&amp;lt;/code&amp;gt; 编辑器将其退格拼接到同一行。&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 五、 特殊疑难杂症：Host key verification failed ==&lt;br /&gt;
这是一个非常经典的报错。表现为你在本地终端输入 &amp;lt;code&amp;gt;ssh root@IP&amp;lt;/code&amp;gt; 后，弹出一大段充满感叹号的警告提示，包含 &amp;quot;WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!&amp;quot;。&amp;lt;blockquote&amp;gt;原理解析：&lt;br /&gt;
&lt;br /&gt;
每次你连接一台全新的 VPS 时，你的本地电脑都会悄悄把这台服务器的唯一指纹记录在本地的一个叫 &amp;lt;code&amp;gt;known_hosts&amp;lt;/code&amp;gt; 的文件里。&lt;br /&gt;
&lt;br /&gt;
如果你把这台 VPS 重装了操作系统，它的服务器指纹就变了。当你再次连接相同的 IP 时，你的本地电脑一对比：“哎？IP 没变，但指纹不对！这可能是一个伪造的钓鱼服务器！” 于是出于保护机制，强制掐断了连接。&amp;lt;/blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;修复 (本地电脑操作)：&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
你只需要告诉你的本地电脑：“我知道它重装了，把旧的指纹删掉吧”。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Windows/Mac/Linux 的终端，直接执行以下命令（将 IP 替换为你的 VPS IP）：&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -R 你的VPS_IP地址&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;系统会提示 &amp;lt;code&amp;gt;Host 你的VPS_IP地址 has been removed&amp;lt;/code&amp;gt;。再次发起 SSH 连接，输入 &amp;lt;code&amp;gt;yes&amp;lt;/code&amp;gt; 接受新的指纹即可。&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 六、 终极救援原则：永远相信 VNC ==&lt;br /&gt;
在这篇指南中，我们反复提到了 VNC Console (或称 KVM/Serial Console)。&lt;br /&gt;
&lt;br /&gt;
请记住一条铁律：只要你的 VPS 还在开机状态，无论 SSH 怎么崩溃、无论防火墙怎么乱拦截，VNC 控制台永远能让你以物理机插显示器的方式进入系统。&lt;br /&gt;
&lt;br /&gt;
VNC 是不依赖于系统网络配置的底层带外管理工具。如果你尝试了上述所有方法依然无果，请静下心来：&lt;br /&gt;
&lt;br /&gt;
# 打开服务商面板的 VNC。&lt;br /&gt;
# 输入 &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; 和密码（由于 VNC 是模拟物理键盘，可能不支持复制粘贴，且注意排查输入法的大写锁定）。&lt;br /&gt;
# 使用 &amp;lt;code&amp;gt;ping 8.8.8.8&amp;lt;/code&amp;gt; 测试外网连通性。&lt;br /&gt;
# 使用 &amp;lt;code&amp;gt;ip addr&amp;lt;/code&amp;gt; 检查网卡是否正常获取了 IP 地址。&lt;br /&gt;
# 检查系统日志 &amp;lt;code&amp;gt;tail -n 50 /var/log/auth.log&amp;lt;/code&amp;gt; 来寻找 SSH 拒绝登录的蛛丝马迹。&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 结语与下一步行动 ==&lt;br /&gt;
SSH 故障排查是一个建立排错逻辑的绝佳过程。当你能够熟练地从网络层、服务层、认证层逐一剥丝抽茧定位问题时，你就不再是一个只会复制粘贴命令的新手，而是初步具备了独立解决问题的架构师思维。&lt;/div&gt;</summary>
		<author><name>Sky</name></author>
	</entry>
</feed>