SSH-server auth timeout configuration

Hello,

I’m managing a bunch of Mikrotiks over very bad connections, sometimes with very aggressive QoS applied, and a lot of the time I get disconnected while logging in with an “Auth timeout” message.

Here’s an example log from the client’s side.

[...]
[2023-11-24 12:52:33] debug1: Remote protocol version 2.0, remote software version ROSSSH
[...]
[2023-11-24 12:52:33] debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
[2023-11-24 12:52:33] debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
[2023-11-24 12:52:40] debug1: SSH2_MSG_KEX_DH_GEX_GROUP received
[...]
[2023-11-24 12:52:43] debug1: expecting SSH2_MSG_NEWKEYS
[2023-11-24 12:52:58] debug1: SSH2_MSG_NEWKEYS received
[...]
[2023-11-24 12:52:58] Received disconnect from 172.29.116.71 port 22:11: auth timeout

Apart from waiting for the connection to improve, I either try to SSH constantly in a while loop or force password authentication, if the Mikrotik has a known password (and always-allow-password-login has been set previously). Once it connects, it works, regardless of the huge lag.

While I appreciate that these delays are not normal, still is there a way to increase the timeout? sshd_config equivalent would be LoginGraceTime.