title: Ansible to Cisco IOS via SSH, with "authentication failed" message
body: <p>Here is a very simple ansible case which bothered me a lot.</p>
  
  <p>This is the content of ansible.cfg:</p>
  
  <pre><code>[defaults]
  transport = paramiko
  hostfile = ./hosts
  host_key_checking = False
  timeout = 5
  </code></pre>
  
  <p>the content of hosts, all with a user named "cisco" and password of "cisco" too</p>
  
  <pre><code>[routers]
  R1
  R2
  R3
  ...
  </code></pre>
  
  <p>the host variable file (R1), similar to R2, R3, ..., just different in IP addresses:</p>
  
  <pre><code>---
  ansible_ssh_host: 10.10.10.1
  ansible_ssh_user: cisco
  ansible_ssh_pass: cisco
  </code></pre>
  
  <p>I can successfully SSH to those routers via linux, but when I use ansible, it resulted in "authentication failed":</p>
  
  <pre><code>fatal: [R1] =&gt; {'msg': 'FAILED: Authentication failed.', 'failed': True}
  fatal: [R2] =&gt; {'msg': 'FAILED: Authentication failed.', 'failed': True}
  ...
  </code></pre>
  
  <p>and I tested the connectivity with some one line ansible commands, still getting errors even when I input the username and password manually, for example:</p>
  
  <pre><code>&gt; ansible routers -m raw
  R1 | FAILED =&gt; FAILED: Authentication failed.
  R2 | FAILED =&gt; FAILED: Authentication failed.    
  
  &gt; ansible routers -u cisco -m raw
  R1 | FAILED =&gt; FAILED: Authentication failed.
  R2 | FAILED =&gt; FAILED: Authentication failed.
  
  &gt; ansible routers -u cisco -m raw -k
  SSH password:
  R1 | FAILED =&gt; FAILED: Authentication failed.
  R2 | FAILED =&gt; FAILED: Authentication failed.
  </code></pre>
  
  <p>How can I solve this? helps will be appreciated.</p>