문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top