同時SSHセッションを制限することはできません。

同時SSHセッションを制限することはできません。

現在問題が発生しましたdropbear。最大同時SSHセッション数を10に設定しましたが、まだssh11番目のセッションを確立できます。何が間違っているのか教えてもらえますか?

cat /proc/sys/kernel/pty/max
10

私は64ビットプラットフォームを使用しています。

ベストアンサー1

SSHサーバーは、MaxSessions構成ファイルのオプションを使用してこれらの制限を適用できます。しかし、それによるとSSHの人々

MaxSessions
     Specifies the maximum number of open shell, login or subsystem
     (e.g. sftp) sessions permitted per network connection.  Multiple
     sessions may be established by clients that support connection
     multiplexing.  Setting MaxSessions to 1 will effectively disable
     session multiplexing, whereas setting it to 0 will prevent all
     shell, login and subsystem sessions while still permitting for-
     warding.  The default is 10.

 MaxStartups
     Specifies the maximum number of **concurrent   unauthenticated con-
     nections to the SSH daemon.**  Additional connections will be
     dropped until authentication succeeds or the LoginGraceTime
     expires for a connection.  The default is 10:30:100.

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

Dropbearクライアントとサーバーの両方で完全なSSHバージョン2プロトコルを実装します。したがって、次のようなコマンドを実行する必要があると思います。

ssh  stream  tcp  nowait/3  root  /usr/sbin/sshd  sshd -i -4

これにより、同時SSH接続の数が3に制限されます。必要に応じて調整してください。

おすすめ記事