How to restrict number of sftp sessions on a per user basis

Solution Unverified - Updated -


  • A valid user opens more and more sftp sessions, in the end the network stack overflow will kill all access to the machine, and other connections will not be accepted anymore.
  • MaxSessions setting in sshd_config does not restrict number of individual sessions.
  • maxlogins in /etc/security/limits.conf limits individual ssh sessions on user basis, but not number of sftp sessions on per user basis.


  • Red Hat Enterprise Linux 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In