云服务器的连接,客户端出现“服务器发送了一个意外的数据包。received: 3,expected: 20

发布时间 2023-07-11 15:53:03作者: 巫小诗

云服务器的连接,客户端出现“服务器发送了一个意外的数据包。received: 3,expected: 20 的解决方案

  1. 编辑 /etc/ssh/sshd_config 文件 并添加四行代码
ClientAliveInterval 60
ClientAliveCountMax 3
PermitRootLogin yes
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
  1. 重启sshd
systemctl reload sshd