Sometimes (not always) ssh login times out, no password prompt, just hangs

I’m having issues with SSH to several devices. One in particular is a CCR2216 running 7.20.4 (just rebooted and upgraded). CPU load is low, system is routing about 3Gbps.

Sometimes, Trying to ssh will "hang” and eventually return a password prompt or timeout.
Other times, SSH connects immediately successful.

No HTTPs issues to the same box when the SSH attempt is ‘hanging’, so that rules out TCP not getting there.

Running TCPDUMP on the DNS server, and I don’t see any requests from the router during SSH attempts (successful or failed). (I don’t even think the Mikrotik SSH server does DNS requests for SSH sessions)

I do have several cronjobs scraping information via SSH from my routers. Is there a ‘limit per minute’ of ssh connections? @helipos mentioned some issue with connecting from an automated script, maybe that is related.

Anyone else find this issue and solve it?

Maybe related:

Do you have the same problem using 7.19.x ?
7.20 chain is for some considered to be "problematic" for quite a few things.
Downgrading to 7.19 can rule it out (or not).

When troubleshot the ssh connection my suggestion is to just add some -vvv to the command.
ssh -vvv admin@192.168.88.1

Have seen lot's of problem with ssh when connecting to a ssh server not supporting some of the authentication protocols and so on.

And if you disconnect from a ssh server like when your wifi router maybe change the channels, so the connection breaks. The session hangs in the server. And when you tries to connect again from the same ip you can't connect.

I Have troubleshot that a lot, and I have to edit this ssh server settings in the file sshd_config. To this values, so the server checks the connection to the client every minute, and try's that two times. Then it's just drops the session.
And you can now connect again.

ClientAliveInterval 60
ClientAliveCountMax 2

Don't know how the ssh server settings in the Mikrotik Device has being set with this only settings.

The automated script issue I have is a pretty niche problem. It needs Teraterm version higher than 4.106, teraterm lauched from a macro, plus a round trip time >10-50ms plus a ROS version higher than 7.4.

Also in my thread it was pointed out some issues with 7.20.2, so as was suggested by @holvoetn try 7.19 and see if anything changes.