# error in asnible ""msg": "Failed to authenticate: Authentication failed: transport shut down or saw EOF""

**URL:** <https://forum.ansible.com/t/error-in-asnible-msg-failed-to-authenticate-authentication-failed-transport-shut-down-or-saw-eof/38635>\
**Category:** Ansible Project\
**Created:** [December 25, 2023, 4:52pm UTC](https://forum.ansible.com/t/error-in-asnible-msg-failed-to-authenticate-authentication-failed-transport-shut-down-or-saw-eof/38635 "2023-12-25T16:52:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed\_mostafa](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mohamed\_mostafa](https://forum.ansible.com/u/mohamed_mostafa)\
**Post date:** [December 25, 2023, 4:52pm UTC](https://forum.ansible.com/t/error-in-asnible-msg-failed-to-authenticate-authentication-failed-transport-shut-down-or-saw-eof/38635/1 "2023-12-25T16:52:38Z")

</div>

dears,

Kindly help to solve this issue, i have the below error when run ad-hoc command "ios\_ping "

[mohamedlocalhost proj]$ ansible -m ios\_ping 192.168.1.101 -a “dest=192.168.1.101”  
SSH password:  
[WARNING]: ansible-pylibssh not installed, falling back to paramiko  
192.168.1.101 | FAILED! =\> {  
“changed”: false,  
“msg”: “Failed to authenticate: Authentication failed: transport shut down or saw EOF”

i can use ping module normally please check attachment 1

the ansible can ssh this device .101 , this device is eve-ng cisco L3 IOL .when i check the logs and make debug on it i found below

\*Dec 25 16:46:01.337: SSH2 0: MAC compared for #5 :ok  
\*Dec 25 16:46:01.337: SSH2 0: input: padlength 15 bytes  
\*Dec 25 16:46:01.337: SSH2 0: Using method = publickey  
\*Dec 25 16:46:01.337: SSH2 0: Received publickey algo = rsa-sha2-512  
\*Dec 25 16:46:01.337: SSH2 0: Unsupported public key algorithm rsa-sha2-512 in SSH2\_MSG\_USERAUTH\_REQUEST  
\*Dec 25 16:46:01.337: SSH0: password authentication failed for root

---

<div class="post-metadata">

**Author:** ![Alex\_D1](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Alex\_D1](https://forum.ansible.com/u/Alex_D1)\
**Post date:** [January 5, 2024, 2:28pm UTC](https://forum.ansible.com/t/error-in-asnible-msg-failed-to-authenticate-authentication-failed-transport-shut-down-or-saw-eof/38635/2 "2024-01-05T14:28:55Z")

</div>

Hi. I have the same problem with Ansible 2.16.2 installed via PIP in venv.

Using the same config/inventory/playbook I have no problems when using Ansible 2.9.6 installed on Ubuntu 20.04 with Python 3.8

This is my cfg file:

[defaults]  
inventory = ./inventory  
host\_key\_checking = False  
retry\_files\_enabled = False  
gathering = explicit

action\_warnings = False  
library =

[persistent\_connection]  
command\_timeout = 200  
connect\_timeout = 200  
connect\_retry\_timeout = 100

This is my inventory file

[all]

[all:children]  
ios  
nxos

[all:vars]  
ansible\_user=alexd  
ansible\_password=S00perP@ss!  
ansible\_connection = ansible.netcommon.network\_cli

### This is needed for IOS, IOS-XE, NXOS

connect\_timeout = 200  
command\_timeout = 200  
#connection = paramiko

[ios]

[ios:children]  
routers  
switches

[ios:vars]  
ansible\_network\_os=cisco.ios.ios  
ansible\_become=yes  
ansible\_become\_method=enable  
ansible\_become\_password=Enable

[routers]  
R1 ansible\_host=192.168.122.10  
R2 ansible\_host=192.168.122.12

And this is the playbook:

- name: “PLAY 1: Gather Data from network devices”  
hosts: R2  
connection: paramiko  
collections:
- cisco.ios  
gather\_facts: false  
become: true  
become\_method: enable

tasks:

- name: “TASK 1: IOS \>\> Show version”  
cisco.ios.ios\_command:  
commands: show version  
register: show\_version

- name: “TASK 2: debug”  
debug:  
msg: “{{ show\_version }}”

The ansible ping Work perfectly with both routers.

(venv) ubuntu@ubuntu:~/DevAuto/AnsibleTest2$ ansible -m ping routers  
[WARNING]: ansible-pylibssh not installed, falling back to paramiko  
R2 | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}  
R1 | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}

However playbook fails with “Authentication failed” message  
(venv) ubuntu@ubuntu:~/DevAuto/AnsibleTest2$ ansible-playbook get\_info\_ios.yml

PLAY [PLAY 1: Gather Data from network devices] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [TASK 1: IOS \>\> Show version] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[WARNING]: ansible-pylibssh not installed, falling back to paramiko  
fatal: [R2]: FAILED! =\> {“changed”: false, “msg”: **“Failed to authenticate: Authentication failed: transport shut down or saw EOF”}**

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
R2 : ok=0 changed=0 unreachable=0 **failed=1** skipped=0 rescued=0 ignored=0

Need help!
