# Ssh load-balancing

**URL:** <https://www.ruby-forum.com/t/ssh-load-balancing/242836>\
**Category:** NGINX\
**Created:** [July 31, 2015, 7:06pm UTC](https://www.ruby-forum.com/t/ssh-load-balancing/242836 "2015-07-31T19:06:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [July 31, 2015, 7:06pm UTC](https://www.ruby-forum.com/t/ssh-load-balancing/242836/1 "2015-07-31T19:06:06Z")

</div>

Hi,

Im new to nginx and am trying to load-balance ssh sessions to an  
autoscaling group of ECS instances in AWS.

Having trouble getting my config files right. I dont get any errors on  
startup, but my access.logs shows this lines for each attempt and the  
command line gives me this :

ssh [ec2-user@10.172.60.7](mailto:ec2-user@10.172.60.7)

ssh\_exchange\_identification: Connection closed by remote host

Access.log:

10.172.200.18 - - [31/Jul/2015:15:54:15 +0000] “SSH-2.0-OpenSSH\_6.2” 400  
173 “-” “-” “-”

10.172.200.18 - - [31/Jul/2015:16:25:31 +0000] “SSH-2.0-OpenSSH\_6.2” 400  
173 “-” “-” “-”

10.172.200.18 - - [31/Jul/2015:16:34:31 +0000] “SSH-2.0-OpenSSH\_6.2” 400  
173 “-” “-” “-”

Any direction would be appreciated.

Thanks, Jerry

Jerome (Jerry) Wyman  
Technical Consultant  
(207) 751-6613  
removed\_email\_address@domain.invalid

This communication is Confidential Information. By using this message  
and attachments you implicitly consent to terms and conditions set forth  
at [http://www.taos.com/email\_disclaimer](http://www.taos.com/email_disclaimer). If you do not consent or  
received this message in error, please destroy it.

---

<div class="post-metadata">

**Author:** ![Jerry\_Wyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jerry\_Wyman](https://www.ruby-forum.com/u/Jerry_Wyman)\
**Post date:** [July 31, 2015, 7:54pm UTC](https://www.ruby-forum.com/t/ssh-load-balancing/242836/2 "2015-07-31T19:54:01Z")

</div>

Hello!

On Fri, Jul 31, 2015 at 05:05:22PM +0000, Jerry Wyman wrote:

> Access.log:
> 
> 10.172.200.18 - - [31/Jul/2015:15:54:15 +0000] “SSH-2.0-OpenSSH\_6.2” 400 173 “-”  
> “-” “-”
> 
> 10.172.200.18 - - [31/Jul/2015:16:25:31 +0000] “SSH-2.0-OpenSSH\_6.2” 400 173 “-”  
> “-” “-”
> 
> 10.172.200.18 - - [31/Jul/2015:16:34:31 +0000] “SSH-2.0-OpenSSH\_6.2” 400 173 “-”  
> “-” “-”
> 
> Any direction would be appreciated.

Looks you are trying to balance ssh connections using http module.  
This won’t work, as http is only able to balance http requests,  
not arbitrary connections.

If you want to balance ssh connections, try using the stream  
module instead:

> **[Module ngx\_stream\_core\_module](http://nginx.org/en/docs/stream/ngx_stream_core_module.html)**

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

The stream module is designed to balance arbitrary connections,  
and should work for you.

> This communication is Confidential Information. By using this  
> message and attachments you implicitly consent to terms and  
> conditions set forth at [Platform Engineering Services | IBM](http://www.taos.com/email_disclaimer). If  
> you do not consent or received this message in error, please  
> destroy it.

By posting to this list you’ve agreed that the message will be  
publicly available. If you want your messages to be confidential,  
please consider using commercial support, see  
[NGINX | F5](https://www.nginx.com/support/).

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![Jerry\_Wyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jerry\_Wyman](https://www.ruby-forum.com/u/Jerry_Wyman)\
**Post date:** [July 31, 2015, 9:27pm UTC](https://www.ruby-forum.com/t/ssh-load-balancing/242836/3 "2015-07-31T21:27:33Z")

</div>

On 7/31/15 8:05 PM, Jerry Wyman wrote:

> Hi,
> 
> Im new to nginx and am trying to load-balance ssh sessions to an  
> autoscaling group of ECS instances in AWS.

[…]

Just curious: is it just a test or a real use-case? Why does anybody  
want to load-balance ssh?

–  
Maxim K.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![Jerry\_Wyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@Jerry\_Wyman](https://www.ruby-forum.com/u/Jerry_Wyman)\
**Post date:** [August 1, 2015, 12:30am UTC](https://www.ruby-forum.com/t/ssh-load-balancing/242836/4 "2015-08-01T00:30:24Z")

</div>

Thanks Maxim,

I’ll give that a try.

Much appreciated, Jerry

Posted at Nginx Forum:

> **[Re: ssh load-balancing](https://forum.nginx.org/read.php?2,260683,260691#msg-260691)**
>
> Hi, I’m new to nginx and am trying to load-balance ssh sessions to an autoscaling group of ECS instances in AWS. Having trouble getting my config files right. I don’t get any errors on startup, but my access.logs shows this lines for each attempt and...
