• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

韩工

  • 博客园
  • 管理

公告

View Post

SSH登录提示加密算法协商失败

Unable to negotiate with 172.16.24.254 port 22: no matching host key type found. Their offer: ssh-rsa

Unable to negotiate with 172.16.29.254 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

这个错误表明在尝试使用 ssh 连接到远程服务器时,客户端和服务器之间没有匹配的 host key 类型。具体来说,远程服务器提供了 ssh-rsa 类型的 host key,但 SSH 客户端配置可能不再支持这些较旧的算法。最近的 OpenSSH 版本默认禁用了不够安全的算法,如 ssh-rsa 

解决办法1:    #使用如下命令进行SSH登录连接

ssh -o HostKeyAlgorithms=+ssh-rsa admin@172.16.24.254

  

解决办法2:

vi ~/.ssh/config      #客户端电脑创建config文件并添加如下内容

Host *
  Ciphers +aes128-cbc
  KexAlgorithms +diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
  HostKeyAlgorithms +ssh-rsa

  

征途漫漫,惟有奋斗!

posted on 2025-03-14 14:51  韩工-Hill  阅读(532)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3