I am using Puppet PE 2017.3.5.0-1 on a CentOS7 AWS instance. When I SSH into this machine, to a default installation, I am getting limited to two connections only. When I try to connect again (from a 3rd terminal) the connection is closed automatically.
I'm not able to connect more than twice at the same time. I am using multiplexing.
I see a setting in /etc/ssh/sshd_config
that says MaxSessions 2
, which I highly suspect has something to do with it, but adjustments are not helping.
The issue is in the
/etc/ssh/sshd_config
there is an entry in thereMaxSessions
. If this is set to a number1
, this means multiplexing is disabled. if it is set to0
, this means that login/shell/subsystem sessions are disallowed entirely. See here for a more descriptive answer on this here https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter.Once you adjust this setting to 2 or more, (more than 2 in this case), or comment the line altogether, you have it correctly adjusted for more than 2 multiplexed connections now.
The problem was for me, After these settings were adjusted, I still wasnt able to connect to more than 2, even if i disconnected entirely and tried again.
I found the solution there was that you need to open the socket directory listed in
.ssh/config
, e.g..ssh
or.ssh/cm_socket
, then remove the socket, because it retains this info. Once you delete the socket, ensuring you have restarted the sshd daemon, then your new settings will take effect.