title: ansible ssh error during pre ping to cisco device
body: <p>Could not connect to Cisco router using Ansible 2.3.1.0</p>
  
  <p>straight from linux ssh cisco@172.1.1.2 works</p>
  
  <p>but the ansible -m ping all doesnt.
  Maybe it's clear where could be a problem from this output:</p>
  
  <pre><code>[osboxes@osboxes ~]$ ansible -m ping servers -vvv
  
  Using /etc/ansible/ansible.cfg as config file
  META: ran handlers
  Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/ping.py
  &lt;172.1.1.2&gt; ESTABLISH SSH CONNECTION FOR USER: cisco
  &lt;172.1.1.2&gt; SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=cisco -o ConnectTimeout=10 -o ControlPath=/home/osboxes/.ansible/cp/1ed8487ad4 172.1.1.2 '/bin/sh -c '"'"'echo ~ &amp;&amp; sleep 0'"'"''
  &lt;172.1.1.2&gt; (0, '\r\nLine has invalid autocommand "/bin/sh -c \'echo ~ &amp;&amp; sleep 0\'"', '')
  &lt;172.1.1.2&gt; ESTABLISH SSH CONNECTION FOR USER: cisco
  &lt;172.1.1.2&gt; SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=cisco -o ConnectTimeout=10 -o ControlPath=/home/osboxes/.ansible/cp/1ed8487ad4 172.1.1.2 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo Line has invalid autocommand "/bin/sh -c '"'"'"'"'"'"'"'"'echo ~ &amp;&amp; sleep 0'"'"'"'"'"'"'"'"'"/.ansible/tmp/ansible-tmp-1499178341.35-260752414357590 `" &amp;&amp; echo ansible-tmp-1499178341.35-260752414357590="` echo Line has invalid autocommand "/bin/sh -c '"'"'"'"'"'"'"'"'echo ~ &amp;&amp; sleep 0'"'"'"'"'"'"'"'"'"/.ansible/tmp/ansible-tmp-1499178341.35-260752414357590 `" ) &amp;&amp; sleep 0'"'"''
  &lt;172.1.1.2&gt; (0, '\r\nLine has invalid autocommand "/bin/sh -c \'( umask 77 &amp;&amp; mkdir -p "` echo Line has invalid autocommand "/bin/sh -c \'"\'"\'echo ~ &amp;&amp; sleep 0\'"\'"\'"/.ansible/tmp/ansible-tmp-1499178341.35-260752414357590 `" &amp;&amp; echo ansible-tmp-1499178341.35-260752414357590="` echo Line has invalid autocomma"', 'muxclient: master hello exchange failed\r\n')
  &lt;172.1.1.2&gt; PUT /tmp/tmpacZGSy TO "` echo Line has invalid autocomma"/ping.py
  &lt;172.1.1.2&gt; SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o User=cisco -o ConnectTimeout=10 -o ControlPath=/home/osboxes/.ansible/cp/1ed8487ad4 '[172.1.1.2]'
  &lt;172.1.1.2&gt; (255, '', 'Connection closed\r\n')
  172.1.1.2 | UNREACHABLE! =&gt; {
      "changed": false, 
      "msg": "Failed to connect to the host via ssh: Connection closed\r\n", 
      "unreachable": true
  </code></pre>
  
  <p>thanks for any tips.</p>