Mac Yosemite 中通过 wifi 连接时出现 Ssh/Ping 问题,但通过以太网连接时则不行

Mac Yosemite 中通过 wifi 连接时出现 Ssh/Ping 问题,但通过以太网连接时则不行

我使用 Mac Yosemite OS 通过 ssh 连接到我的办公室服务器。我无法通过任何 Wifi 连接(我的公寓的 wifi 或我工作场所的 wifi)。但是,当我通过以太网连接时,我能够执行 ssh。我做了以下事情来解决问题,但没有成功。

  1. 我关闭了防火墙但仍然无法连接。
  2. 我 ping 了我的服务器,并得到了 Request timeout状态。但是,当我通过我的其他服务器 ping 或 ssh 时Mac(搭载 Maverick OS),我能够得到我的 ping 消息的积极响应并且连接上(如果有任何 wifi)。

  3. 我执行了 ssh -vvv 用户名@主机,收到了以下消息

    OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: /etc/ssh_config line 20: Applying options for *
    debug1: /etc/ssh_config line 100: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to <server name> [<server ip address>] port 22.
    debug1: connect to address <server ip address> port 22: Operation timed out 
    ssh: connect to host <server name> port 22: Operation timed out
    
  4. 我重新安装了 OpenSSL,但仍然无法解决问题。

  5. 当我使用 Cyber​​duck、Firezilla 或 VNC 时也遇到了类似的问题,但我的另一台装有 OS Maverick 的计算机没有出现这种情况。

您有什么想法或建议可以让我尝试吗?谢谢!

******更新 1******

我删除了 OpenSSL 和 brew,并尝试连接到服务器。我做到了

ssh -vvv uname@<server-name>

该消息表明连接已建立。但是,出现以下消息后我无法继续操作:

debug1: SSH2_MSG_SERVICE_ACCEPT received

以下是完整信息:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 100: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <server name> [<ip address>] port 22.
debug1: Connection established.
debug1: identity file /Users/snape/.ssh/id_rsa type -1
debug1: identity file /Users/snape/.ssh/id_rsa-cert type -1
debug1: identity file /Users/snape/.ssh/id_dsa type -1
debug1: identity file /Users/snape/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "dna.nri.bcm.edu" from file "/Users/aayushraman/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/aayushraman/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found [email protected]
debug1: kex: server->client aes128-ctr [email protected] none
debug2: mac_setup: found [email protected]
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 127/256
debug2: bits set: 504/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 59:d3:ec:27:16:df:01:04:8a:7a:92:34:3f:91:16:8d
debug3: load_hostkeys: loading entries for host "dna.nri.bcm.edu" from file "/Users/snape/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/snape/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "10.34.48.30" from file "/Users/snape/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/snape/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host '<server name>' is known and matches the RSA host key.
debug1: Found key in /Users/snape/.ssh/known_hosts:1
debug2: bits set: 513/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received

另外,当我尝试执行 ping 时,我可以执行此操作并能够收到消息而没有错误!

我认为我已经非常接近解决方案了,并且确定 brew 在我的 mac yosemite 上无法正常工作。

********更新 2**********

我能够通过以下方式解决问题:

  1. 去除酿造
  2. 基本上给出 UseDNS 的论点为否

    vi /etc/sshd_config 使用DNS

  3. 服务 sshd 重新启动

    取消设置 SSH_AUTH_SOCK

然后执行 ssh

答案1

我能够通过以下方式解决问题:

  1. 去除酿造
  2. 基本上给出 UseDNS 的论点为否

    vi /etc/sshd_config 使用DNS

  3. 服务 sshd 重新启动

    取消设置 SSH_AUTH_SOCK

  4. 然后执行 ssh

相关内容