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

2021-06-11 12:36:46 +08:00
 herozzm

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

1451 次点击
所在节点    macOS
7 条回复
lcdtyph
2021-06-11 13:07:14 +08:00
??建议你重新搜索
从来没听说哪个系统升级会动~/.ssh 的
MrCurly
2021-06-11 13:08:44 +08:00
不可能。。你看看是不是权限变了
doveyoung
2021-06-11 13:52:13 +08:00
是不是换用户了。。。。或者是权限不对,连不上的报错信息是什么
ssh -v [user]@[ip] -p 22 -i [key]
Tink
2021-06-11 14:20:52 +08:00
错误提示是什么
herozzm
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: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com 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 no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com 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
2021-06-11 15:48:33 +08:00
明明是都已经 Authentication succeeded (publickey) 了。后面被踢掉估计是别的原因了。
我 big sur 登 ssh 好好的啊。
thunderw
2021-06-11 15:57:27 +08:00
有人说 /etc/ssh/ssh_config 里加这一句可以搞定。估计是新版和你的服务器有啥不兼容的情况
Host *
IPQoS=throughput

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/782871

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX