自从我更新到 Ventura 后,我无法从 macOS 通过 SSH 连接到我的服务器(Ubuntu 20.04)

自从我更新到 Ventura 后,我无法从 macOS 通过 SSH 连接到我的服务器(Ubuntu 20.04)

升级到 macOS Ventura & OpenSSH_9.0p1、LibreSSL 3.3.6 后,我无法通过 SSH 连接特定服务器,例如 AWS、DigitalOcean 的微型/小型实例等

client_1 日志

ssh -vvv user@server -p port

OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug2: resolve_canonicalize: hostname host is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/user/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to host [host] port port.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
ssh: connect to host host port port: Operation timed out

wireshark

client_1 日志的 wireshark 屏幕截图

服务器日志

tcpdump -n -vv -i any src or dst xxx.xxx.xxx.xxx

Empty 

答案1

对我有用的解决方案

https://apple.stackexchange.com/a/279061/478974

编辑客户端配置文件(用户:~/.ssh/config或者系统:/etc/ssh/ssh_config) 并添加以下行:

Host *
  IPQoS 0x00

您可能只想为特定主机添加此配置,也许这​​是一种更好的方法,请了解如何执行此操作[此处][1]。

另外,我不是 SSH 专家。如果你想了解更多关于 IPQoS 选项的作用,你可能会在 [这里][2] 找到一些有用的信息。[1]: https://www.youtube.com/watch?v=MWqfc_fegVg [2]: https://man7.org/linux/man-pages/man5/ssh_config.5.html

答案2

我的情况也是同样的错误。我使用的是 MAC,使用 bitbucket 时出错。在 MAC 上升级到 Ventura 后,这需要除 rsa 之外的其他身份验证算法。以前我的密钥是 rsa。但我从 bitbucket 中删除了我的 rsa 公钥,并添加了使用 ed25519 算法生成的新公钥。 ssh-keygen -t ed25519 添加这个新公钥后,它就开始为我工作了更多信息:https://statistics.berkeley.edu/computing/ssh-keys

相关内容