Jor*_*vez 3 ssh networking 22.04
我最近在两台不同的计算机上升级到 Ubuntu 22.04 LTS,它们有一个令人困惑的行为:
我认为这个问题:
在这里找到完整的详细输出,希望它有帮助:
alice:~$ ssh -vvv externalHost
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/user/.ssh/known_hosts2'
debug2: resolving "externalHost" port 22
debug3: resolve_host: lookup external-host:22
debug3: ssh_connect_direct: entering
debug1: Connecting to externalHost [XXXXX] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address XXX port 22: Connection timed out
ssh: connect to host externalHost port 22: Connection timed out*
Run Code Online (Sandbox Code Playgroud)
使用 strace 我检测到最后的系统调用,当执行在超时之前被阻止时
...
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, [128 => 16]) = 0
getpid() = 10276
setsockopt(3, SOL_IP, IP_TOS, [16], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("externalHost-IPaddress")}, 16) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
Run Code Online (Sandbox Code Playgroud)
小智 7
由于我无法发表评论,所以我将其作为答案。我遇到了同样的问题,经过几个小时的搜索找到了解决该问题的方法。
我添加了
IPQoS none
Run Code Online (Sandbox Code Playgroud)
到我的 /etc/ssh/ssh_config
看起来上一个版本中 ssh 客户端发生了一些变化,并且与本地路由器通信时出现问题。
我希望它有帮助。
| 归档时间: |
|
| 查看次数: |
7786 次 |
| 最近记录: |