阿里云服务区ECS,申请免费的服务器之后,如何使用xshell 登陆,找不到匹配的host key 算法

1 问题

当在阿里云免费领取服务器之后,使用xshell 登陆不上,提示

找不到匹配的host key 算法
或者
找不到匹配的keyexchange算法

咋解决

2 解决

在在服务器端配置文件:/etc/ssh/sshd_config

# 在行尾增加",ecdh-sha2-nistp521",以满足ecdsa公钥方式登录(密钥长度521)
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp521

# 在行尾增加",ssh-rsa",以满足RSA 登录
HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa

# 在行尾增加",ssh-rsa",以满足RSA 登录
PubkeyAcceptedKeyTypes ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa

在这里插入图片描述
保存 systemctl restart ssh 即可。

猜你喜欢

转载自blog.csdn.net/python113/article/details/132344883