securecrt连接服务器报错 Key exchange failed 怎么办
新买了一台阿里云机,用securecrt去连接,如下报错
这个错误表明你的 SSH 客户端与服务器之间无法就密钥交换方法和主机密钥算法达成一致,导致连接失败。这通常是由于客户端和服务器支持的加密算法集不匹配造成的。
解决方式
编辑服务器的/etc/ssh/sshd_config,添加
HostKeyAlgorithms ssh-dss,ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
然后重启ssh/sshd解决