MaxSessions option in sshd_config

Damien Miller djm at
Wed Aug 17 10:20:11 EST 2011

On Tue, 16 Aug 2011, Surya Santosh wrote:

> Hi,
> I need information regarding MaxSessions option in sshd_config. As
> i understand, it defines the maximum number of channels that can be
> opened at any point of time between two hosts that are connected over
> SSH. The default value for this option is 10 in openSSH. What all
> needs to be considered if i want to increase this value? Are there any
> security concerns with increase of this value or does memory usage of
> SSHD increases? Please help.

I'm not aware of any security considerations, but if you increase the
limit too far then you might run out of file descriptors in the sshd
that is serving the connection. sshd tries to do the right thing in this
case, but it might cause the whole connection to terminate if it gets it

Each session may use up to five fds, and you will need more a handful
more file descriptors for the network connection and housekeeping. Also
remember that each port-, X11 and agent forwarding session requires at
least two more.


More information about the openssh-unix-dev mailing list