I am trying to prevent my ssh users from having more than one session open at once, my system is Ubuntu 11.10.
I thought the setting was in /etc/security/limits.conf
where I set the following:
betatest hard maxlogins 1
However, this has no effect and I can log in multiple times using user account name betatest from different machines.
The sshd_config
is using PAM and the login and sshd configs in /etc/pam.d
both have the setting:
session required pam_limits.so
If anyone knows how I can restrict the concurrent sessions on a per user basis I would really appreciate the help.
Best Answer
It appears to me, from the MAN page for pam_limits (at least on rhel/centos), that adding a maxlogins parameter for the desired user(s) would do the trick... but I haven't tested it: