ssh加速,自动添加到know_hosts

简介:
经常遇到这样的问题,如下,很是麻烦,找到了解决办法
 
[root@xytr1 ~]#   ssh 192.168.5.56
The authenticity of host '192.168.5.56 (192.168.5.56)' can't be established.
RSA key fingerprint is a1:7f:35:ec:1a:5e:33:df:e8:82:56:cf:b6:99:b6:b9.
Are you sure you want to continue connecting (yes/no)? yes ß 这里一定要确认才能通过
Warning: Permanently added '192.168.5.56' (RSA) to the list of known hosts.
Last login: Tue Jul 13 16:29:52 2010 from linux1
 
解决方案是,把   本地   ssh 客户端配置文件  ssh_config  做修改
[root@xytr1 ~]#  vi /etc/ssh/ssh_config
找到:
#   StrictHostKeyChecking ask
修改为
    StrictHostKeyChecking no
 
这样下次就不会出现需要确认的提示了。
 
这个选项会自动的把  ssh  的机器添加到  /root/.ssh/know_hosts  中(也就是不需要你手工的输入 yes
如果远程机器遭到了修改,也会有错误提示,不过不会影响 ssh 登陆,如下
 
[root@xytr1 ~]#  ssh 192.168.5.56    ß   这里我再次 ssh 到这台机器
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a1:7f:35:ec:1a:5e:33:df:e8:82:56:cf:b6:99:b6:b9.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:137
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Last login: Tue Jul 13 16:45:31 2010 from linux1
[root@searchweb16 ~]#    ß   如上所示,出现了提示,但是我们还是可以正常的 ssh 到远程。
 
同时如果修改 ssh_config 中的 GSSAPIAuthentication 参数为 no 或者直接注销该参数,可以解决有时候ssh狂慢的问题。Authentication 参数是用于 Kerberos 验证的,而我们不可能使用这种验证机制









本文转自 justiceplus 51CTO博客,原文链接:http://blog.51cto.com/johnwang/348712,如需转载请自行联系原作者
目录
相关文章
|
3月前
|
Linux 网络安全
Linux命令(124)之ssh
Linux命令(124)之ssh
33 2
|
5月前
|
监控 数据可视化 安全
Linux——怎样使用SSH服务实现远程UI界面本地显示
需求场景 最近几天需要实现软件的远程监控,但是实际场景又不能使用向日葵、VNC、AnyDesk、以及其他的监视软件,并且软件的整体设计也没有这块的数据上行设计。
176 0
|
5月前
|
Linux 网络安全 开发工具
Linux之ssh
Linux之ssh
40 0
|
5月前
|
Linux 网络安全
linux端口连通性测试telnet、wget、ssh、curl
linux端口连通性测试telnet、wget、ssh、curl
|
4月前
|
安全 网络协议 Linux
Linux ssh 命令详解
Linux ssh 命令详解
115 0
|
6月前
|
网络协议 Ubuntu Linux
VSCode使用Remote SSH远程连接Linux服务器【远程开发】
VSCode使用Remote SSH远程连接Linux服务器【远程开发】
|
1月前
|
网络协议 Ubuntu Linux
「远程开发」VSCode使用SSH远程linux服务器 - 公网远程连接
「远程开发」VSCode使用SSH远程linux服务器 - 公网远程连接
111 0
|
1月前
|
安全 Linux Shell
|
2月前
|
安全 网络协议 Linux
|
2月前
|
存储 Linux 网络安全
如何在 Linux 中删除 SSL 证书和 SSH 密码?
如何在 Linux 中删除 SSL 证书和 SSH 密码?
79 1
如何在 Linux 中删除 SSL 证书和 SSH 密码?