Currently, I am running into an issue with dropbear. I have set the maximum number of concurrent ssh sessions to 10 but I still able to ssh an 11th sessions. Would you please let me know what I am doing wrong?

cat /proc/sys/kernel/pty/max

I am using a 64bit platform.

  • 1
    I'm not sure that limiting the number of pseudo terminals will do what you want. You may have better luck looking at maxsyslogins in /etc/security/limits.conf. See man limits.conf for more information Commented Sep 21, 2018 at 13:16
  • I have had no luck with MaxSessions using SLES 11.4; I have it set to 1 and I can have multiple putty ssh terminals connected to my linux server in addition to other users doing the same, at the same time. That being said if you run in to a similar issue with MaxSessions never working you might focus on the version of SSH being implemented. There is also the UsePAM yes in sshd_config as well as PAM itself where you could write up a rule in PAM to enforce what you want... easier said than done unfortunately
    – ron
    Commented Sep 24, 2018 at 17:20

2 Answers 2


The SSH server can impose such limits with the MaxSessions option in the configuration file. However, according to ssh man

     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.

     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 implements the complete SSH version 2 protocol in both the client and the server. so, I believe you should run something like this command:

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

That limits the number of concurrent ssh connections to 3. Adjust as you would like.


Based on hours of experimentation, Dropbear does not register via user sessions via PAM so adding any rule whose type is session for the dropbear application is point-less. I was however successful with sshd. Additionally I found this link of someone else pointing this out.


  • 1
    Please clarify what you are saying about sshd. … … … … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. Commented Apr 7, 2022 at 23:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .