When you’re setting up a personal server for the first time, you may find yourself with quite a few questions about what it is, or is not capable of doing. With that in mind, today’s SuperUser Q&A post has answers for a curious reader’s question.
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
Screenshot courtesy of Casablanca (Wikimedia Commons).
The Question
SuperUser reader Sam3000 wants to know if It is possible to have multiple SSH connections to the same system:
Is it possible to have multiple SSH connections to the same system?
The Answer
SuperUser contributors badge-be and Hastur have the answer for us. First up, badge-be:
Followed by the answer from Hastur:
Yes, it usually works by default.
The Long Answer
It depends on what you are using it for. It may slow down with multiple connections, but that is a bandwidth issue, not an SSH issue.
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
grep “Protocol” /etc/ssh/sshd_config
Limits for the Connections
You can look upon SSH as an encrypted evolution of telnet, born to allow remote access to a server. Note that SSH connects over TCP and it is able to forward X-sessions (graphical sessions) too. Multi-tasking and multiple users are a part of the inner nature of Unix (even if it is not without limits).
You can see some of those limits in the TCP and SSH limits:
cat /proc/sys/net/core/somaxconn (usually 128, to see the maximum number of TCP outstanding connections you can have)
The kern.ipc.somaxconn sysctl(8) variable limits the size of the listening queue for accepting new TCP connections. The default value of 128 is typically too low for robust handling of new connections on a heavily loaded web server.
cat /proc/sys/net/core/netdev_max_backlog (usually 1000, the maximum length of the TCP packet queue) less /etc/security/limits. conf (you can find the limits for the number of users) MaxSessions in /etc/ssh/sshd_config (specifies the maximum number of open sessions permitted per network connection, the default is set at 10) #MaxStartups 10:30:60, usually commented in the /etc/ssh/sshd_config (specifies the maximum number of concurrent unauthenticated connections to the SSH daemon, the default is set at 10)
References
man ssh and man sshd on your computer
The man pages for sshd and sshd_config