posts - 327,  comments - 2,  views - 11万

最近在Mac上想要远程一台Linux服务器,结果不知怎么的就不能使用以前的ssh登录了

iot@ios-iMac ~ % ssh root@192.168.1.230                             

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

 

查了下,需要指定加密连接方式,结果如下:

复制代码
 iot@ios-iMac ~ % ssh -oHostKeyAlgorithms=+ssh-dss root@192.168.1.230

The authenticity of host '192.168.1.230 (192.168.1.230)' can't be established.

DSA key fingerprint is SHA256:***********5+75ZypSQtVtGGJNbbA/6amkjEDA.

This key is not known by any other names

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Warning: Permanently added '192.168.1.230' (DSA) to the list of known hosts.

root@192.168.1.230's password: 

Last login: Fri Jun 28 16:35:41 2024 from 192.168.9.16
复制代码

这样就可以连接成功了,但是那个参数复杂又不能自动不全,比较麻烦,不想每次都输怎么办?

Mac上可以这样处理:

 

 iot@ios-iMac ~ % sudo vim /etc/ssh/ssh_config

最后一行添加全局变量:

    HostKeyAlgorithms +ssh-dss
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
#   UserKnownHostsFile ~/.ssh/known_hosts.d/%k
Host *
    SendEnv LANG LC_*
    HostKeyAlgorithms +ssh-dss

这样操作以后就不用每次都带那个参数了,可以像之前一样使用简单版的ssh root@IP了

其它平台应该也是类似的,在ssh的配置文件中添加全局选项即可解决问题,我这个是Mac升级系统导致的。

对了,以上是在客户端操作的!

 

posted on   我在全球村  阅读(967)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek-R1本地部署如何选择适合你的版本?看这里
· 开源的 DeepSeek-R1「GitHub 热点速览」
· 传国玉玺易主,ai.com竟然跳转到国产AI
· 揭秘 Sdcb Chats 如何解析 DeepSeek-R1 思维链
· 自己如何在本地电脑从零搭建DeepSeek!手把手教学,快来看看! (建议收藏)
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示