我正在使用本地运行的群集工具(hadoop),该工具必须能够执行无密码的ssh,如下所示:
ssh $(hostname)
在我的Mac笔记本电脑上,这不起作用。这是相关的条目/etc/hosts
127.0.0.1 localhost
xx.xx.242.47 TCA0080ALKVTAGB
可以ping
使用主机名:
ping $(hostname)
PING TCA0080ALKVTAGB.local (xx.xx.242.47): 56 data bytes
64 bytes from xx.xx.242.47: icmp_seq=0 ttl=64 time=0.044 ms
64 bytes from xx.xx.242.47: icmp_seq=1 ttl=64 time=0.115 ms
但是尝试ssh
输入主机名不起作用:
$ssh $(hostname)
ssh: Could not resolve hostname tca0080alkvtagb: nodename nor servname provided, or not known
通过添加.local
偶数.ssh
作品
ssh $(hostname).local # this works
注意:我已经添加.local
了全局搜索域(通过System Preferences | Network | Advanced | DNS
):
问题是公司防火墙与DNS混乱了(是的-甚至对于本地计算机的解析也是如此。)。我不知道详细信息,但是当禁用防火墙时,DNS正在工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句