ssh: handshake errors drop the text sshd sends before its version line
OpenSSH 9.8 and later refuse a connection under PerSourcePenalties or MaxStartups by writing Not allowed at this time where the version string would go, then closing the socket (drop_connection() in sshd.c; 9.7 and earlier wrote Exceeded MaxStartups). x/crypto skips lines that arrive before the version string, as RFC 4253 section 4.2 allows, so rig reports only
ssh dial: ssh: handshake failed: EOF
or read: connection reset by peer. From the client side that reads as a network problem. We ran into this with k0sctl against RHEL 9 hosts running OpenSSH 9.9: the person debugging it looked at firewalls and an access-control appliance before finding drop connection ... penalty: exceeded LoginGraceTime in the host's sshd journal. The one line that pointed at sshd had reached the client and been dropped.
To reproduce, listen on a port, write Not allowed at this time\r\n to each connection and close it, then Connect to it with protocol/ssh.
Proposal: keep what the server sends before its version line, bounded and quoted, and add it to the handshake error when the handshake fails before any version line arrives. I have a PR ready and will link it here.
Filed by an AI agent (Claude Code) at the request of @100milliongold, who will follow up on this issue.