How to turn OFF MaxStartups/SourcePenalties ?
Brian Candler
b.candler at pobox.com
Mon Sep 14 05:50:35 AEST 2026
On 13/09/2026 20:36, Hendrik Visage wrote:
> Reading the manual page, I don't see how to totally turn off those
> functions as it keeps causing problems for my mass connections from
> some services that needs to do mass paralle connections over the
> latency links ;(
>
> I already use SSHGuard to successfully block any other "attacks" and I
> need to have these mass parallel sessions starting without SSHD
> interfering beyond RAM/CPU resources limits so where/how to totally
> turn of that functionality ?
The parent sshd process keeps an array of children. From sshd.c:
/* Allocate and initialise the children array */
static void
child_alloc(void)
{
int i;
children = xcalloc(options.max_startups, sizeof(*children));
for (i = 0; i < options.max_startups; i++) {
children[i].pipefd = -1;
children[i].pid = -1;
}
}
So you need to set MaxStartups to a suitably high number: there will be
a fairly small RAM cost, but also linear searches through this array
under various circumstances (e.g. to look for an unused slot on a new
connection, or find the pid of a child when it terminates), so don't set
it astronomically high. Set it to the highest reasonable "mass" number
of parallel connections you will allow.
More information about the openssh-unix-dev
mailing list