Limiting number of ssh session

159 views
Skip to first unread message

sabraham

unread,
Jun 3, 2016, 8:02:50 PM6/3/16
to CoreOS User
Hi 

Is there a way to limit number of ssh session on CoreOs. 
I have tried setting MaxSessions to 1 in /etc/ssh/sshd_config  but the system still allow more than one ssh session.

Michael Marineau

unread,
Jun 3, 2016, 8:37:12 PM6/3/16
to shijin abraham, coreos-user

We run sshd in a socket activated per session mode by default so some sshd_config settings like port or number of connections won't be applicable since sshd isn't responsible for whole system settings like that. Instead the sshd.socket unit can be customized to manage such things. For example you should get what you want by writing the following to /etc/systemd/system/sshd.socket.d/limit.conf

[Socket]
MaxConnections=1

See https://www.freedesktop.org/software/systemd/man/systemd.socket.html

Hi 

Is there a way to limit number of ssh session on CoreOs. 
I have tried setting MaxSessions to 1 in /etc/ssh/sshd_config  but the system still allow more than one ssh session.

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sabraham

unread,
Jun 6, 2016, 5:45:45 PM6/6/16
to CoreOS User, shijin...@gmail.com
thank you Michael Marineau 
Reply all
Reply to author
Forward
0 new messages