Winston
Winston

Reputation: 85

SSH: How could I know the concurrent limit?

In order to test SSH server, I created a test program (in python) on the client side. The test program will generate 100 processes, each process will make a SSH connection with the server. Any failed attempt will wait for 10 seconds and retry.

Here is my observation:

  1. On the first 10 seconds, only 30 of the client could create a successful connection. 70 clients were rejected.
  2. On the next 10 seconds, another 30 clients could create a successful connection. 40 were rejected.
  3. On the next 10 seconds, another 30 clients could create a successful connection. 10 were rejected.
  4. On the next 10 seconds, last 10 client could create a successful connection.

Here are my questions:

  1. Is it possible to make 100 successful secured connection in one go? Which SSH parameter (server side) I need to modify in order to achieve this?
  2. Python has a built-in SSL library. If I use SSL to replace SSH, could I make 100 successful secured connection in one go?

Thanks in advance

Upvotes: 3

Views: 4388

Answers (1)

Aya
Aya

Reputation: 42020

I would like to log in 100 concurrent connection in one go. Which SSH paramerters I need to modify?

Well, I asked you to specify which ssh server you were using, but since you didn't respond, I'll have to assume you're using openssh.

The only sshd_config(5) configuration parameter I can see which might affect the number of connections you can make 'simultaneously' is MaxStartups, for which the docs say...

Specifies the maximum number of concurrent unauthenticated connections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10.

Alternatively, random early drop can be enabled by specifying the three colon separated values “start:rate:full” (e.g. "10:30:60"). sshd(8) will refuse connection attempts with a probability of “rate/100” (30%) if there are currently “start” (10) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches “full” (60).

...so you'll probably have to set that value to at least 100.

Upvotes: 4

Related Questions