Load balancer for SSH connections

0

I set-up a git server hosted in an EC2 instance. I used an ALB for it to use my certificate and domain. For HTTP/S connections it used the domain, however I cannot do the same with SSH. It still uses the Elastic IP for connections.

  • Git clone using HTTPS: git clone https://my.domain.com/username/myrepository.git
  • Git clone using SSH: git clone git@ec2-54-146-90-61.compute-1.amazonaws.com:username/myrepository.git

Is there a way for both connections to use my domain? Furthermore, when multiple users use SSH, some got connection time out. I would appreciate any advice.

2개 답변
2

Client's request to GIT should load balanced to same server regardless of service, I mean HTTPS and SSH ? Than i dont think you could find the sollution from AWS native. You could use 3rd party sollutions like F5, NSX-ALB(AVI).

If its ok to load balance SSH and HTTPS to different target servers, you could consider using NLB instead of ALB.

V
답변함 10달 전
  • V. Thank you for the insight. Is it possible that I just "clone" my current instance and then use it as targets for both HTTPS and SSH in NLB? I haven't tried NLB yet that's why I am not familiar.

1

Hello.
The only protocols that can be used with ALB are HTTP or HTTPS.
So SSH cannot be used.
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-configuration

When using SSH, it is better to use NLB or set up a domain on EC2.
If you set up a domain on EC2, you may want to use a free certificate such as Let's Encrypto for issuing SSL certificates.

The error that occurs when multiple users connect via SSH may be due to Linux or SSH session limitations.
If it is an SSH error, check "/var/log/syslog" or "/var/log/secure" to see if any logs have appeared.

profile picture
전문가
답변함 10달 전
profile pictureAWS
전문가
검토됨 10달 전
profile picture
전문가
Steve_M
검토됨 10달 전
  • The error that occurs when multiple users connect via SSH may be due to Linux or SSH session limitations.

    Yes, check MaxSessions in /etc/ssh/sshd_config:

         MaxSessions
                 Specifies the maximum number of open shell, login or
                 subsystem (e.g. sftp) sessions permitted per network
                 connection.
    
  • Thank you for your answers. I was able to have better understanding. In that case, what would be the realistic value for MaxSessions? Currently, I am using t3.medium instance, should I use a more "powerful" instance to accommodate, let's say 150 sessions?

  • Thank you for your reply. MaxSessions for sshd is 10 by default. I think t3.medium can withstand about 150 simultaneous connections.

  • Yes, NLB is the only way to go for SSH load-balancing. Have a look at this article to see differences in details.

    https://medium.com/awesome-cloud/aws-difference-between-application-load-balancer-and-network-load-balancer-cb8b6cd296a4

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠