How to restrict number of sftp sessions on a per user basis
Issue
- 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.
MaxSessionssetting insshd_configdoes not restrict number of individual sessions.maxloginsin/etc/security/limits.conflimits individual ssh sessions on user basis, but not number of sftp sessions on per user basis.
Environment
- Red Hat Enterprise Linux 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.