Xshell通过SSH连接阿里云报错“服务器发送了一个意外的数据 ubuntu kali
有勇气的牛排
2441
linux
2021-08-26 21:57:34
问题
在阿里云的ubuntu系统用xshell连接发现报错无法连接,百度了一圈好多方法不行,这里给出我最后解决的方法。
xshell报错提示:服务器发送了一个意外的数据包。received: 3,expected: 20

1.在服务器查看报错
首先在阿里云在浏览器登录阿里云,查看sshd状态
发现有有很多红色的报错,我就选择了第一条报错百度了下
命令:systemctl status sshd.service
报错:error: kex protocol error: type 30 seq 1 [preauth]
2.解决方法
命令: vim /etc/ssh/sshd_config
打开sshd_config并且将下面的复制进去保存,然后重启reboot即可。
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
执行完此步骤后继续查看sshd状态 发现所有的报错完美解决。
参考:
https://blog.csdn.net/dingshangfu2977/article/details/101957061
https://blog.csdn.net/weixin_34357962/article/details/94498362
<h2><a id="_0"></a>问题</h2>
<p>在阿里云的ubuntu系统用xshell连接发现报错无法连接,百度了一圈好多方法不行,这里给出我最后解决的方法。<br />
xshell报错提示:服务器发送了一个意外的数据包。received: 3,expected: 20</p>
<p><img src="https://static.couragesteak.com/article/869c7d60ead13aa70a55894c6b1064a1.png" alt="image.png" /></p>
<h3><a id="1_9"></a>1.在服务器查看报错</h3>
<p>首先在阿里云在浏览器登录阿里云,查看sshd状态<br />
发现有有很多红色的报错,我就选择了第一条报错百度了下<br />
命令:<strong>systemctl status sshd.service</strong><br />
报错:<strong>error: kex protocol error: type 30 seq 1 [preauth]</strong></p>
<h3><a id="2_15"></a>2.解决方法</h3>
<p>命令: <strong>vim /etc/ssh/sshd_config</strong><br />
打开sshd_config并且将下面的复制进去保存,然后重启reboot即可。</p>
<pre><code class="lang-">KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
</code></pre>
<p>执行完此步骤后继续查看sshd状态 发现所有的报错完美解决。</p>
<p>参考:<br />
https://blog.csdn.net/dingshangfu2977/article/details/101957061<br />
https://blog.csdn.net/weixin_34357962/article/details/94498362</p>
留言