MindStudio SSH连接Atlas500小站失败,报错Algorithm negotiation fail

问题描述

1)在MindStudio上,打开SSH Configurations页面,输入Atlas500的连接信息,点击Test Connection按钮后,弹框提示“Can’t connect to remote host!”;
2)打开MindStudio的后台日志文件idea.log,发现一条警告级别的打印“Algorithm negotiation fail”;
3)使用MobaXterm工具可以通过SSH成功连上Atlas500

处理过程

1)使用MobaXterm等SSH工具登录Atlas500后台,切换至root用户;
2)执行命令service sshd status,可以看到有报错信息“Unable to negotiate with X.X.X.X port 57625: no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 [preauth]”。说明SSH客户端(即MindStudio)使用了ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521加密算法,但是服务端sshd没有配置支持这些算法。
3)打开/etc/ssh/sshd_config文件,找到HostKeyAlgorithms和PubkeyAcceptedKeyTypes配置,如下:

download.png

发现确实没有支持“ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521”,从而导致协商失败

解决方案

登录Atlas500小站后台,切换至root用户,打开/etc/ssh/sshd_config文件,在HostKeyAlgorithms和PubkeyAcceptedKeyTypes配置项增加ssh-rsa,如下:
1
HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa
2
PubkeyAcceptedKeyTypes ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-512,ssh-rsa
保存后,执行service sshd restart重启sshd服务即可。

免责声明:本案例仅供参考不提供专业意见。

阅读剩余
THE END
阿里云ECS特惠活动
阿里云ECS服务器 - 限时特惠活动

云服务器爆款直降90%

新客首单¥68起 | 人人可享99元套餐,续费同价 | u2a指定配置低至2.5折1年,立即选购享更多福利!

新客首单¥68起
人人可享99元套餐
弹性计费
7x24小时售后
立即查看活动详情
阿里云ECS服务器特惠活动