SSH 因连接超时而失败 - 在 VPN 中并挂在这里“期待 SSH2_MSG_KEX_ECDH_REPLY”+ Ubuntu 16.04.6 LTS

Jay*_*Jay 7 vpn networking openconnect 16.04

提出错误 -> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1874257

SSH 超时问题,一旦连接到 VPN。

通过腻子连接罚款。之前没有做任何改动。

通过开放连接建立的 VPN。这是以前的工作。重新安装 VPN 软件包并重新启动仍然没有运气

环境

Dell XPS 9570
Ubuntu 16.04.6 Xenial Xerus)
kernel - 4.15.0-55-generic

$dpkg -l | grep -i openssh
ii openssh-client 1:7.2p2-4ubuntu2.8 -->
ii openssh-server 1:7.2p2-4ubuntu2.8
ii openssh-sftp-server 1:7.2p2-4ubuntu2.8

VPN tunnel info
====
vpn0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:IP P-t-P:xx Mask:255.255.252.0
          inet6 addr: fe80::b8e2:bea4:2e62:fe08/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1406 Metric:1
          RX packets:962 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1029 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:87839 (87.8 KB) TX bytes:238740 (238.7 KB)

Run Code Online (Sandbox Code Playgroud)

问题

VPN 连接后无法通过 ssh 或 sftp 连接到任何主机

试过

重新安装了 openssh-client 软件包,但仍然没有运气。我可以知道为什么默认密码没有被占用/挂起吗?请告诉我 。最近没有变化。

解决方法

能够连接到 ssh / sftp $ssh -c aes128-ctr user@IP

下面是调试 ssh 客户端日志 ===

$ssh -vvv user@ip
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "IP" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to IP [IP] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1



debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256@libssh.org
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
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

<< Hangs here >>


Run Code Online (Sandbox Code Playgroud)

请发表一些看法

谢谢

bfr*_*uci 12

作为临时解决方法,手动设置 KEX 算法为我解决了这个问题。

添加KexAlgorithms ecdh-sha2-nistp521到相应的SSH配置中,或者添加-oKexAlgorithms=ecdh-sha2-nistp521到命令行args中一次性使用。

参考文献(2019): https: //superuser.com/a/1462220/555702


小智 10

将 MTU 设置为 1200 为我解决了这个问题(Ubuntu 20.04)。

with (replace {dev}):  
sudo ip li set mtu 1200 dev {dev}
Run Code Online (Sandbox Code Playgroud)


Jay*_*Jay 4

问题的根本原因是 openconnect VPN 客户端包的 MTU 处理无法协商。错误-> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1874257