You can try setting a restriction in /etc/security/limits.conf
. According to man limits.conf
from my system, you should be able to write
* hard maxsyslogins 6
سؤال
I need a limit (let's say to 6) how many users can be logged in my Linux (CentOS 6.3) system. Users use ssh to connect my server. Server is meant to do simulations and that's why I have need to restrict maximum number of users whom can use the server at a time, because the resources are limited.
I tried to change sshd_config MaxSessions and MaxStartups but no cigar.
If the sshd does not provide this kind of limitation, is there possibility to restrict maximum number of logged-in users via PAM or SELinux
المحلول
You can try setting a restriction in /etc/security/limits.conf
. According to man limits.conf
from my system, you should be able to write
* hard maxsyslogins 6