设置如下,我有四台机器:
- A:一个 Ubuntu 盒子,充当 ssh 客户端;
- 乙:一台运行 El Capitan(OS X 10.11)的 iMac,我想要连接的 ssh 服务器;
- C:另一台运行 Mavericks(OS X 10.9)的 iMac;
- 德:Synology NAS(DSM 5.2);
从A我可以连接到C和德。 从C和德我可以连接到乙。但当我尝试连接到乙从A我收到以下消息:
在A(-vvv
可选):
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 2a01:********* [2a01:*********] port22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/<user>/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/<user>/.ssh/id_rsa type 1
debug1: identity file /home/<user>/.ssh/id_rsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_dsa type -1
debug1: identity file /home/<user>/.ssh/id_dsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_ed25519 type -1
ebug1: identity file /home/<user>/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
ssh_exchange_identification: Connection closed by remote host
在乙:
sshd[7215]: error: BSM audit: getaddrinfo failed for UNKNOWN: nodename nor servname provided, or not known
sshd[7215]: Could not write ident string to UNKNOWN
com.apple.xpc.launchd[1] (com.openssh.sshd.1681EC73-750F-45A5-998D-B54A0BBE893E[7215]): Service exited with abnormal code: 255
到底是怎么回事?
答案1
看起来是防火墙问题。为了通过 ssh 连接,您必须允许launchd
(而不是sshd
)接受传入连接。