Score:2

Limiting concurrent Ubuntu session not working!

ro flag

I am trying to limit my user's concurrent logins. Every user should be able to have a limited number of simultaneous ssh connections to my Ubuntu 20.04 LTS server.

Here's what I've done so far:

  1. To /etc/pam.d/sshd, I added session required pam_limits.so
  2. To /etc/security/limits.conf, I added the following:
    • username hard maxlogins 1
      • I also tried:
        • username - maxlogins 1
        • * - maxlogins 1
  3. In sshd_config UsePAM yes was not commented by default
  4. I then ran sudo /etc/init.d/ssh restart
  5. Finally, I ran reboot server

But still, I could do login with ssh to my Ubuntu 20.04 LTS server through several clients!

What am I missing?

Alex avatar
ro flag
Sorry I just doubled check it, It's a Ubuntu 20.04 LTS server, Thanks for your comment
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.