Sobes.tech
Junior — Middle

What reasons can cause multiple users to be unable to connect to the server simultaneously using the same account via SSH?

sobes.tech AI

Answer from AI

One of the reasons why multiple users cannot connect simultaneously to a server via the same SSH account could be a limit on the number of concurrent sessions in the SSH server configuration (/etc/ssh/sshd_config). The parameters MaxSessions or MaxStartups may restrict the number of simultaneous connections.

Other possible reasons:

  • Limitations set in PAM or security policies on the server for the number of sessions per user.
  • Restrictions in AllowUsers or AllowGroups settings.
  • Session limits set at the account level (e.g., via ulimit or /etc/security/limits.conf).
  • Restrictions imposed by ForceCommand or other restrictions that prevent multiple sessions.

Example of checking and changing the parameter in /etc/ssh/sshd_config:

# Maximum number of concurrent sessions
MaxSessions 10

# Maximum number of concurrent connection attempts
MaxStartups 10:30:100

After changing the configuration, restart the SSH service:

sudo systemctl restart sshd