我习惯于在 Windows 机器上或 OSX 命令行终端上使用 Putty SSH 到 NAS,而无需对客户端进行任何配置。
Ubuntu 16.04 尝试通过 SSH 连接到 NAS(通过 LAN):
ssh root@192.168.8.109
Unable to negotiate with 192.168.8.109 port 22: no matching host key type found. Their offer: ssh-dss
Run Code Online (Sandbox Code Playgroud)
Kal*_*mér 187
16.04 中包含的 OpenSSH 版本禁用了 ssh-dss。有一个包含此问题的遗留信息的整洁页面:http : //www.openssh.com/legacy.html
简而言之,您应该将选项添加-oHostKeyAlgorithms=+ssh-dss到 SSH 命令:
ssh -oHostKeyAlgorithms=+ssh-dss root@192.168.8.109
Run Code Online (Sandbox Code Playgroud)
您还可以在您的主机中添加一个主机模式,~/.ssh/config这样您就不必每次都指定密钥算法:
Host nas
HostName 192.168.8.109
HostKeyAlgorithms=+ssh-dss
Run Code Online (Sandbox Code Playgroud)
这有一个额外的好处,您不需要输入 IP 地址。相反,ssh将识别主机nas并知道连接到哪里。当然,您可以使用任何其他名称来代替。
Fab*_*ler 147
如果您来到这里是因为 Bitbucket 在更新到 OpenSSH 8.8 后返回以下内容:
Unable to negotiate with <ip address> port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
Run Code Online (Sandbox Code Playgroud)
你不应该启用DSS(就像在接受的答案中一样),而应该启用RSA ~/.ssh/config:
Host bitbucket.org
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
Run Code Online (Sandbox Code Playgroud)
请注意,这是本文中建议的PubkeyAcceptedKeyTypes向后兼容的别名 。PubkeyAcceptedAlgorithms如果您使用它,则相同的配置可以用于较旧的 OpenSSH 客户端版本,例如,如果您与 docker 容器共享配置。
您可以对其他主机执行相同的操作,或者用于Host *允许任何主机使用 RSA。
168*_*556 23
在 /etc/ssh/ssh_config.d/ 中创建扩展名为 *.conf 的新文件
sudo nano /etc/ssh/ssh_config.d/my.conf
Run Code Online (Sandbox Code Playgroud)
添加到新的空行:
HostKeyAlgorithms ssh-rsa,ssh-dss
PubkeyAcceptedKeyTypes ssh-rsa,ssh-dss
Run Code Online (Sandbox Code Playgroud)
小智 12
编辑 ~/.ssh/config 文件是最好的选择。如果在同一子网上有多个主机要连接,则可以使用以下方法避免在文件中输入每个主机:
Host 192.168.8.*
HostKeyAlgorithms=+ssh-dss
Run Code Online (Sandbox Code Playgroud)
这对我很有用,因为我有许多 Brocade 交换机需要管理,并且在我迁移到 Ubuntu 16.04 后他们开始抱怨 Host 密钥。
小智 11
对我来说,这添加到.ssh\config工作中:
Host *
HostkeyAlgorithms +ssh-dss
PubkeyAcceptedKeyTypes +ssh-dss
Run Code Online (Sandbox Code Playgroud)
如果您想使用较新的 OpenSSH 连接到已弃用的服务器:
ssh -o KexAlgorithms=diffie-hellman-group14-sha1 -oHostKeyAlgorithms=+ssh-dss my.host.com
Run Code Online (Sandbox Code Playgroud)
如果您想查看发生了什么,请添加 -v,如果仍然不起作用,请添加 -o HostKeyAlgorithms=ssh-dss:
ssh -v -o HostKeyAlgorithms=ssh-dss -o KexAlgorithms=diffie-hellman-group14-sha1 my.host.com
Run Code Online (Sandbox Code Playgroud)
当然,您也可以编辑 /etc/ssh/ssh_config 或 ~/.ssh/ssh_config,并添加:
Host my.host.com *.myinsecure.net 192.168.1.* 192.168.2.*
HostKeyAlgorithms ssh-dss
KexAlgorithms diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)
https://forum.ctwug.za.net/t/fyi-openssh-to-access-rbs-openssh-7/6069提到了 Mikrotik Routerboards 的以下修复:
/ip ssh set strong-crypto=yes
Run Code Online (Sandbox Code Playgroud)
(这里没有这个,因为在寻找类似的错误消息时,这个答案也会出现在网络搜索中。)
| 归档时间: |
|
| 查看次数: |
296926 次 |
| 最近记录: |