Is het mogelijk om meerdere SSH-verbindingen op hetzelfde systeem te hebben?

Inhoudsopgave:

Video: Is het mogelijk om meerdere SSH-verbindingen op hetzelfde systeem te hebben?

Video: Is het mogelijk om meerdere SSH-verbindingen op hetzelfde systeem te hebben?
Video: The Difference Between Jailbreaking And Unlocking 2024, Maart
Is het mogelijk om meerdere SSH-verbindingen op hetzelfde systeem te hebben?
Is het mogelijk om meerdere SSH-verbindingen op hetzelfde systeem te hebben?
Anonim
Wanneer u voor de eerste keer een persoonlijke server opzet, ondervindt u mogelijk nogal wat vragen over wat deze is, of niet in staat om te doen. Met dat in gedachten heeft de SuperUser Q & A-post van vandaag antwoorden voor een nieuwsgierige lezer.
Wanneer u voor de eerste keer een persoonlijke server opzet, ondervindt u mogelijk nogal wat vragen over wat deze is, of niet in staat om te doen. Met dat in gedachten heeft de SuperUser Q & A-post van vandaag antwoorden voor een nieuwsgierige lezer.

De Question & Answer-sessie van vandaag komt tot ons dankzij SuperUser - een onderdeel van Stack Exchange, een community-driven groep van Q & A-websites.

Screenshot met dank aan Casablanca (Wikimedia Commons).

De vraag

SuperUser-lezer Sam3000 wil weten of het mogelijk is om meerdere SSH-verbindingen te hebben met hetzelfde systeem:

I have a Linux computer acting as a server that can accept incoming SSH connections. Is it possible to reliably connect multiple devices at the same time, such as my mobile phone and laptop, as well as other desktops, to the same server using SSH?

Is het mogelijk om meerdere SSH-verbindingen te hebben met hetzelfde systeem?

Het antwoord

Bijdragers van SuperUser badge-be en Hastur hebben het antwoord voor ons. Ten eerste, badge-be:

The Short Answer

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.

Gevolgd door het antwoord van Hastur:

Yes it is possible, it is the default behavior. You can rely on it if you are using an updated version of SSH and it is no longer set to Protocol 1. The command below should give you Protocol 2.

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

1. man ssh and man sshd on your computer

2. The man pages for sshd and sshd_config

Heb je iets toe te voegen aan de uitleg? Geluid uit in de reacties. Wilt u meer antwoorden van andere technisch onderlegde Stack Exchange-gebruikers lezen? Bekijk de volledige discussiethread hier.

Aanbevolen: