ssh stuck at expecting SSH2_MSG_KEX_ECDH_REPLY

前段时间遇到使用了 WireGuard 的 IP SSH 卡在了 SSH2_MSG_KEX_ECDH_REPLY,使用主机对外的IP又能正常登陆。

debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

一番研究之后发现是 MTU 值偏低导致,在不调整 MTU 的情况下,可以更改 KexAlgorithms 或者 MACs 试试。

ssh [email protected] -v -o KexAlgorithms=ecdh-sha2-nistp521
ssh [email protected] -v -o MACs=hmac-sha2-256

-EOF-