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

macoOS 升级 big sur 后 ssh 私钥无法连接服务器

  •  
  •   herozzm · 2021-06-11 12:36:46 +08:00 · 1462 次点击
    这是一个创建于 1287 天前的主题,其中的信息可能已经有所发展或是发生改变。

    升级前好好的,升级后,ssh 密钥就无法连接之前的服务器了,搜索了一下发现升级后会改变密钥

    第 1 条附言  ·  2021-06-11 14:52:42 +08:00
    brew install openssh

    就行了,还是升级系统的锅
    7 条回复    2021-06-11 15:57:27 +08:00
    lcdtyph
        1
    lcdtyph  
       2021-06-11 13:07:14 +08:00 via iPhone
    ??建议你重新搜索
    从来没听说哪个系统升级会动~/.ssh 的
    MrCurly
        2
    MrCurly  
       2021-06-11 13:08:44 +08:00
    不可能。。你看看是不是权限变了
    doveyoung
        3
    doveyoung  
       2021-06-11 13:52:13 +08:00
    是不是换用户了。。。。或者是权限不对,连不上的报错信息是什么
    ssh -v [user]@[ip] -p 22 -i [key]
    Tink
        4
    Tink  
       2021-06-11 14:20:52 +08:00 via Android
    错误提示是什么
    herozzm
        5
    herozzm  
    OP
       2021-06-11 14:38:35 +08:00
    @doveyoung
    @Tink
    我重新生成密钥,公钥丢服务器上了,但是还是无法连接,windows 客户端正常,唯独 mac 不行,-v 的提示好像没有什么有意义的内容,最后一句是 client_loop: send disconnect: Broken pip

    命令:ssh root@ip 地址 -p 6800 -v -i .ssh/id_rsa

    提示:
    OpenSSH_8.1p1, LibreSSL 2.7.3
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 47: Applying options for *
    debug1: Connecting to ...
    debug1: Connection established.
    debug1: identity file .ssh/id_rsa type 0
    debug1: identity file .ssh/id_rsa-cert type -1
    debug1: Local version string SSH-2.0-OpenSSH_8.1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
    debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
    debug1: Authenticating to ... as 'root'
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: algorithm: curve25519-sha256
    debug1: kex: host key algorithm: ecdsa-sha2-nistp256
    debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
    debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ecdsa-sha2-nistp256 SHA256:eqhZjfKBNpHc23rSU6SXJpmIVxCmcsDPUF8DXhJlgrw
    debug1: Host ... is known and matches the ECDSA host key.
    debug1: Found key in /Users/hero/.ssh/known_hosts:1
    debug1: rekey out after 134217728 blocks
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: rekey in after 134217728 blocks
    debug1: Will attempt key: .ssh/id_rsa RSA SHA256:VNpcJvlrgTcYGbyKY35kp/e/u2/T0XrEiEBA+b0e+WE explicit
    debug1: SSH2_MSG_EXT_INFO received
    debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey
    debug1: Next authentication method: publickey
    debug1: Offering public key: .ssh/id_rsa RSA SHA256:VNpcJvlrgTcYGbyKY35kp/e/u2/T0XrEiEBA+b0e+WE explicit
    debug1: Server accepts key: .ssh/id_rsa RSA SHA256:VNpcJvlrgTcYGbyKY35kp/e/u2/T0XrEiEBA+b0e+WE explicit
    debug1: Authentication succeeded (publickey).
    Authenticated to ....).
    debug1: channel 0: new [client-session]
    debug1: Requesting [email protected]
    debug1: Entering interactive session.
    debug1: pledge: network
    debug1: client_input_global_request: rtype [email protected] want_reply 0
    debug1: Remote: /root/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
    debug1: Remote: /root/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
    debug1: Sending environment.
    debug1: Sending env LC_TERMINAL_VERSION = 3.4.7beta2
    debug1: Sending env LANG = zh_CN.UTF-8
    debug1: Sending env LC_TERMINAL = iTerm2
    client_loop: send disconnect: Broken pip
    thunderw
        6
    thunderw  
       2021-06-11 15:48:33 +08:00
    明明是都已经 Authentication succeeded (publickey) 了。后面被踢掉估计是别的原因了。
    我 big sur 登 ssh 好好的啊。
    thunderw
        7
    thunderw  
       2021-06-11 15:57:27 +08:00
    有人说 /etc/ssh/ssh_config 里加这一句可以搞定。估计是新版和你的服务器有啥不兼容的情况
    Host *
    IPQoS=throughput
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3056 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 13:20 · PVG 21:20 · LAX 05:20 · JFK 08:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.