解决:确保安装了libnss-mdns!
我在使用 .local 主机名从上网本到桌面使用 SSH 时遇到问题。每隔一段时间,我都必须重置我使用的路由器,这会重置它分配给我的设备的地址,所以不久前我设置了 Avahi 来解决这个问题*。/etc/avahi/services/ssh.service 文件是从文档中复制的标准文件:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<!-- See avahi.service(5) for more information about this configuration file -->
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
Run Code Online (Sandbox Code Playgroud)
这曾经工作正常,但现在由于某种原因,当我尝试从上网本 ssh 到我的桌面时,我收到以下错误消息(注意我在此输出中更改了我的电脑的主机名):
user@netbook>> ssh pc.local -vvv
OpenSSH_6.2p2 Ubuntu-6ubuntu0.3, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/username/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
ssh: Could not resolve hostname pc.local: Name or …Run Code Online (Sandbox Code Playgroud)