当前位置: 首页 > news >正文

【linux】SCP或SSH 连接失败: no matching host key type found. Their offer: ssh-rs

scp或者ssh报错“no matching host key type found. Their offer: ssh-rsa,ssh-dss“
原因:OpenSSH 7.0以后的版本不再支持ssh-dss (DSA)算法

aab@aab-virtual-machine:~/桌面/lianxi$ scp text.c root@192.168.1.50:/home/root
Unable to negotiate with 192.168.1.50 port 22: no matching host key type found. Their offer: ssh-rsa
lost connection

或者

root:~ >ssh root@192.168.1.133
Unable to negotiate with 192.168.1.133 port 22: no matching host key type found. Their offer: ssh-rsa

解决办法: 

ssh -i key.pem shell@x.x.x.x -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa

 1每次指令后加上-oHostKeyAlgorithms=+ssh-dss或者-oHostKeyAlgorithms=+ssh-dsa:

2.(推荐)也可以把参数加到 ssh config file, /etc/ssh/ssh_config :,增加以下内容:

HostKeyAlgorithms = +ssh-rsa
PubkeyAcceptedAlgorithms = +ssh-rsa

退出 SSH 连接的方法有以下几种

  • 使用 exit 命令。
  • 使用 logout 命令。
  • 使用 Ctrl + D 键盘组合。
  • 如果 SSH 连接被冻结,可以键入 ~. 关闭 SSH 会话并返回到本地命令行终端。

http://www.mrgr.cn/news/1334.html

相关文章:

  • Python办公自动化:使用openpyxl 创建与保存 Excel 工作簿
  • Webpack高级配置(干货)
  • gitignore忽略某些格式文件
  • 精通网络分析工具:深入探索与实践指南
  • 数据结构-栈
  • 【9.2 python中的参数传递】
  • ardupilot开发 --- 故障保护 篇
  • git的学习教程
  • OD C卷 - 小扇和小船的数字游戏
  • Linux:进程的概念,进程相关函数
  • 硬件I2C和软件I2C(模拟I2C)的区别
  • Therabody™明星产品TheragunⓇ筋膜枪,以科技健康助力舞台高光时刻
  • GO语言如何抗住火影忍者手游的高并发
  • QT C++上位机软件开发,相比较C#上位机软件开发,有哪些特点和区别
  • IOPaint部署,在服务器Ubuntu22.04系统下——点动科技
  • 学习文件IO,让你从操作系统内核的角度去理解输入和输出(理论篇)
  • 使用百度文心智能体创建AI旅游助手
  • Spring中事务(面试常考)
  • STM32初识
  • 记一次Jenkins项目构建耗时优化