Restrict logon to user/restrict ammount of logins

Hello guys,
I have 2 very strange requirements that I should implement:
On some systems I should limit the access to only one specific user (normally we use sssd authenticating to an AD to logon)
And on other systems only one user at once should be allowed to login.

Has anyone any Idea how to implement this?

Best regards,
Romad

On 2012-04-26 16:26, romad wrote:

> Has anyone any Idea how to implement this?

No, but look at pam manuals, it is all controlled there.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi,
tanks for the hint
I found a way to limit to one user this with pam_limits
6.15.
<code> % - maxlogins 1 </code>

and the other case with 6.1.

  • : root : ALL
  • : user1 : ALL
  • : ALL : ALL

you have to add
<code>session required /lib/security/pam_access.so </code>
to /etc/pam.d/common-session

On 2012-05-09 15:16, romad wrote:
>
> Hi,
> tanks for the hint
> I found a way to limit to one user this with pam_limits
> ‘6.15.’ (http://tinyurl.com/6ulr7cv)

Thanks for posting, it may be useful to others coming later. I know very
little about pam, I only could tell you that what you wanted was controlled
by it.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)