V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
bigwhite2021
V2EX  ›  程序员

请教一个 ssh 问题

  •  
  •   bigwhite2021 · 2021-11-08 18:47:43 +08:00 · 1254 次点击
    这是一个创建于 890 天前的主题,其中的信息可能已经有所发展或是发生改变。

    机器为 M1 Macbook air ,操作系统为 macOs Big Sur 11.6 。 今天机器突然不能被 ssh 登陆了,提示

    ssh_exchange_identification: Connection closed by remote host
    

    机器的 system.log 为

    (com.openssh.sshd.86030324-DFE4-4A3F-B3A2-2E56573A7B8A[3627]): Service exited with abnormal code: 255
    

    重启 ssh 服务报错

    (com.apple.xpc.launchd.domain.system): entering bootstrap mode
    (com.openssh.sshd): Unknown key for string: SHAuthorizationRight
    (com.apple.xpc.launchd.domain.system): exiting bootstrap mode
    

    Google 查了半天,没找到解决办法,请教一下各位 v 友有没有碰到类似的情况

    5 条回复    2021-11-08 19:51:31 +08:00
    zpfhbyx
        1
    zpfhbyx  
       2021-11-08 19:10:31 +08:00
    关下全局?
    TomChaai
        2
    TomChaai  
       2021-11-08 19:13:10 +08:00
    这个我猜你找到 sshd 相关的 plist 文件,把里面 SHAuthorizationRight 对应的 key 拿出来看看是什么样的才能知道,你的电脑长什么样我们是看不到的,要你自己去找
    bigwhite2021
        3
    bigwhite2021  
    OP
       2021-11-08 19:48:49 +08:00
    找到原因了,昨晚配置腾讯云的时候老是断开连接,就配置了
    ```
    ServerAliveInterval 30
    ServerAliveCountMax 60
    ```
    这两个参数,把这个两个参数注释了就行了
    bigwhite2021
        4
    bigwhite2021  
    OP
       2021-11-08 19:50:37 +08:00
    @bigwhite2021 但是没找到为什么这两个参数会有影响
    bigwhite2021
        5
    bigwhite2021  
    OP
       2021-11-08 19:51:31 +08:00
    @TomChaai 跟 SHAuthorizationRight 这个报错没关系,现在可以了还是会报
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   998 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.