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

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

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!