kaixuan1901
V2EX  ›  SSH

无法通过域名 SSH 连接

  •  
  •   kaixuan1901 · Apr 25, 2020 · 6465 views
    This topic created in 2225 days ago, the information mentioned may be changed or developed.

    最近使用 SSH 碰过一个奇怪的问题,通过 IP 可以直接 SSH 登录,但用域名会卡在 connecting 的地方。

    • 正常登录
    ssh -p 11200 [email protected]
    
    • 无法登录
    ssh -p 11200 -v [email protected]
    OpenSSH_8.1p1, LibreSSL 2.7.3
    debug1: Reading configuration data /Users/user/.ssh/config
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 47: Applying options for *
    debug1: Connecting to host.abc.com port 11200.
    

    第一反应是 DNS 有问题导致域名无法解析,但 ping 域名能正常解析出 IP 地址,所以 DNS 应该是没问题的。请教一下哪位大大知道可能是什么原因导致的?

    Supplement 1  ·  Apr 28, 2020

    通过重新安装 openssl 解决了这个问题。 brew install openssl

    结果今天使用 ansible 的时候出现了另外一个问题。

    ERROR:root:code for hash md5 was not found.
    ...
    

    然后通过下面的方面解决:

    $ ls /usr/local/Cellar/openssl
    1.0.2s
    
    $ brew switch openssl 1.0.2s
    
    3 replies    2020-04-25 18:31:38 +08:00
    celeron533
        1
    celeron533  
       Apr 25, 2020   ❤️ 1
    苹果最新系统好像有这个问题,网上有人提到过
    xmoon
        2
    xmoon  
       Apr 25, 2020 via Android   ❤️ 1
    如果是 macos 最新版的话 是有这么一个 bug
    kaixuan1901
        3
    kaixuan1901  
    OP
       Apr 25, 2020
    @celeron533
    @xmoon
    感谢提醒,原来是 MacOS 系统的锅,根据你们提示已找到解决方法,安装新版本的 `openssh`

    ```
    brew install openssh
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   850 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 21:02 · PVG 05:02 · LAX 14:02 · JFK 17:02
    ♥ Do have faith in what you're doing.