SSH:我怎么知道并发限制?

2024-05-15 05:05:14 发布

您现在位置:Python中文网/ 问答频道 /正文

为了测试SSH服务器,我在客户端创建了一个测试程序(python)。测试程序将生成100个进程,每个进程将与服务器进行SSH连接。任何失败的尝试将等待10秒,然后重试。在

以下是我的观察:

  1. 在前10秒,只有30个客户端可以创建成功的连接。70个客户被拒绝。在
  2. 在接下来的10秒钟内,另外30个客户端可以创建一个成功的连接。40人被拒绝。在
  3. 接下来的30秒,客户机可以在接下来的10秒内创建另一个成功的连接。10人被拒绝。在
  4. 在接下来的10秒内,最后10个客户端可以创建一个成功的连接。在

以下是我的问题:

  1. 是否可以一次性成功建立100个安全连接?为了实现这一点,我需要修改哪个SSH参数(服务器端)?在
  2. Python有一个内置的SSL库。如果我用SSL代替SSH,我能一次性成功地建立100个安全连接吗?在

提前谢谢


Tags: 服务器客户端ssl参数客户机客户进程服务器端
1条回答
网友
1楼 · 发布于 2024-05-15 05:05:14

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

好吧,我要求您指定您使用的是哪个ssh服务器,但是由于您没有响应,所以我不得不假设您使用的是^{}。在

我能看到的唯一可能影响“同时”连接数的^{}配置参数是MaxStartups,文档对此说。。。在

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).

…所以您可能必须将该值设置为至少100。在

相关问题 更多 >

    热门问题