# frequent ssh drops due to "Connection timed out during banner exchange"

**URL:** <https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540>\
**Category:** Ansible Project\
**Created:** [June 24, 2014, 10:23pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540 "2014-06-24T22:23:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Evgeniev](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@Nick\_Evgeniev](https://forum.ansible.com/u/Nick_Evgeniev)\
**Post date:** [June 24, 2014, 10:23pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/1 "2014-06-24T22:23:49Z")

</div>

Hi,

For some reason if I’m connecting to the host using ansible connection is been dropped frequently with “Connection timed out during banner exchange” message…

Any hints? pls check output below… again if I just ‘ssh lb0014’ everything is fine

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 25, 2014, 12:54am UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/2 "2014-06-25T00:54:11Z")

</div>

Anything particularly interesting about the setup, OSes involved (managed or managing), or network?

---

<div class="post-metadata">

**Author:** ![Nick\_Evgeniev](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@Nick\_Evgeniev](https://forum.ansible.com/u/Nick_Evgeniev)\
**Post date:** [June 25, 2014, 4:13pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/3 "2014-06-25T16:13:43Z")

</div>

Hi,

it’s a LAN with some VLANs configured (out of my control so hardly can tell more). As I don’t see any problem with ssh, I guess it could be ssh library ansible is using.. (needs to be tuned or may be changed?)

ansible version is 1.6.2

controller (ansible) host is osx:

Darwin hostname 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE\_X86\_64 x86\_64

target host is redhat linux:

Linux lb0079 2.6.32-358.14.1.el6.x86\_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86\_64 x86\_64 x86\_64 GNU/Linux

ssh connection is being proxied by:

host lb0\*  
user some\_user

ProxyCommand ssh proxyhost /usr/bin/nc %h %p 2\> /dev/null  
identityfile /Users/e21170/.ssh/id\_dsa

#Host lb0\*

# ControlPath ~/.ssh/%h.%p.%r

# ControlMaster auto

---

<div class="post-metadata">

**Author:** ![Paul\_Durivage](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Paul\_Durivage](https://forum.ansible.com/u/Paul_Durivage)\
**Post date:** [June 25, 2014, 9:49pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/4 "2014-06-25T21:49:29Z")

</div>

How many parallel connections are you proxying through “proxyhost”? My team encounter a similar situation where the “ssh\_config” directive “MaxStartups” was too low, and the ssh connection timeout value was being exceeded connecting to the proxy server.

At any rate, check your proxy’s MaxStartups, and adjust accordingly. You can test if this is an issue by setting a fork limit to 1 – one connection (as opposed to potentially many parallel connections) should be rather quick.

Additionally, I’d look into that proxy command. Is there any reason why you cannot proxy using the -W argument for proxying? I’m curious if the proxy command is wonky and causes some sort of connection problem with ansible’s default SSH configuration settings.

---

<div class="post-metadata">

**Author:** ![Nick\_Evgeniev](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@Nick\_Evgeniev](https://forum.ansible.com/u/Nick_Evgeniev)\
**Post date:** [June 26, 2014, 7:29pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/5 "2014-06-26T19:29:37Z")

</div>

Hi,

MaxStartups is a great idea, thanks! will ask sysadmins to adjust that setting. also no reason not to use -W other than ‘old school’ pattern. switched to it (though i doubt it’s an issue)

---

<div class="post-metadata">

**Author:** ![Nick\_Evgeniev](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@Nick\_Evgeniev](https://forum.ansible.com/u/Nick_Evgeniev)\
**Post date:** [June 30, 2014, 10:23pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/6 "2014-06-30T22:23:39Z")

</div>

it looks like adjusting MaxStartups doesn’t help in my case… also netstat on a proxy machine doesn’t show lots of connections to 22 port… so just wondering what could it be…

just to recap ssh to target host connects quickly all the time. ansible sometimes repeatedly fails… after waiting for approx 1 sec.

---

<div class="post-metadata">

**Author:** ![Paul\_Durivage](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Paul\_Durivage](https://forum.ansible.com/u/Paul_Durivage)\
**Post date:** [July 1, 2014, 3:29pm UTC](https://forum.ansible.com/t/frequent-ssh-drops-due-to-connection-timed-out-during-banner-exchange/15540/7 "2014-07-01T15:29:39Z")

</div>

Have you tried increasing ConnectionTimeout to something higher than 10 seconds?
