Max numer of connections per sshd

Hi people,

How many ssh or scp connections will an sshd process allow to conenct?

I'm hoping this is an easy question.

Linux 2.6.16.21-0.8-smp x86_64 GNU/Linux

I have a Linux server that has spawned 34 sshd processes, thought this doesn't seem to be enough. The server is used for application monitoring and as a result will have a large number of connections made each minute. We now have got to a point where it will not allow new connections.

You either get the "Welcome" message and no prompt or ssh_exchange_identification: Connection closed by remote host

cheers,

Neil

There's no such option in sshd_config file. You can write custom wrapper script, who will be checking connections and their number on the SSH port, if reach max number - print some banner (connection refused : max number reached), if not - print some welcome banner.

You're possibly making connections at a rate which exceeds the number of new connections allowed at any one time.

SSHd will limit new connections, which have not yet completed authentication, in an attempt to avoid DOSing the whole machine if someone were to create thousands of ssh connections to your host.

So although the number of real connections is effectively unlimited AFAIK, there is a hard limit on the number of connections which are made, but are in the process of authenticating.

See the "MaxStartups" explaination in the sshd_config man page for full details.

Hope this helps,

-c

You may find that pseudo-terminals are the limit.

Try using ssh to allocate sessions without a pseudo-terminal using "-T" in the client.

As each session is accepted and forked it should not be a file descriptor per process limit.