Concurrent session limit for SSH is not working #314

Closed
opened 2026-01-19 18:30:02 +00:00 by michael · 1 comment
Owner

Originally created by @cistone on GitHub.

Summary

Setting "os_ssh_max_sessions_configure" does not limit connections on my machine.

Steps to reproduce

Set "MaxSessions 10" in sshd.conf
from another machine, open multiple ssh connections to the ssh server.

Operating System version

20A5343i

What is the current bug behavior?

The number of sessions is not capped at 10.

What is the expected correct behavior?

After 10 connections, further connection attempts should fail.

Originally created by @cistone on GitHub. ### Summary Setting "os_ssh_max_sessions_configure" does not limit connections on my machine. ### Steps to reproduce Set "MaxSessions 10" in sshd.conf from another machine, open multiple ssh connections to the ssh server. ### Operating System version 20A5343i ### What is the current *bug* behavior? The number of sessions is not capped at 10. ### What is the expected *correct* behavior? After 10 connections, further connection attempts should fail.
Author
Owner

@robertgendler commented on GitHub:

The MaxSessions setting within sshd.conf does not do what people think it does exactly.

This turns out the only way to limit it is by editing the kernel variables which is not advised.
sudo sysctl -w kern.tty.ptmx_max=

The AC-10 requirement in the NIST 800-53 is met inherently with os_limit_gui_sessions.

@robertgendler commented on GitHub: The MaxSessions setting within sshd.conf does not do what people think it does exactly. This turns out the only way to limit it is by editing the kernel variables which is not advised. sudo sysctl -w kern.tty.ptmx_max=<number> The AC-10 requirement in the NIST 800-53 is met inherently with os_limit_gui_sessions.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: usnistgov/macos_security#314