(注意:这似乎与现有问题类似,但我相信此处的实现细节有所不同)
我在单个DNS地址后面有几百台主机。每个主机都有自己的单独主机密钥(我不能更改它-它由供应商设置,不能修改)。
当我第二次尝试通过单个名称连接到任何主机时,这ssh
很令人不安:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The DSA host key for (hostname) has changed,
and the key for the corresponding IP address 192.168.0.100
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 a host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
SHA256:+38sJSsANknk6vVIHJ/l/xnPCl+ALCNrbi80vrr24cM.
Please contact your system administrator.
Add correct host key in /Users/me/.ssh/known_hosts to get rid of this message.
Offending DSA key in /Users/me/.ssh/known_hosts:291
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.
Permission denied (publickey,password,keyboard-interactive).
在此环境中安全使用SSH(即尽可能完整地进行验证)的最佳实践是什么?
由于安全性原因,我不想禁用密钥验证,并且连接到单个IP地址的明显解决方法可以绕过供应商的DNS实施提供的负载平衡。
您可以known_hosts
使用来为所有IP预先生成ssh-keyscan
。然后在用户系统上将其设置为GlobalKnownHostsFile
(只读),并对该特定hostname
禁用UserKnownHostsFile
设置(设置为/dev/null
)。
我没有尝试过,但是它应该对IP感到满意,如果不能使用可以写known_hosts
记录hostname
。
客户端示例/etc/ssh/ssh_config
(也很好分发):
[...] # other stuff
Host dns_hostname
GlobalKnownHostsFile /etc/ssh/known_hosts
UserKnownHostsFile /dev/null
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句