# The connection plugin 'libssh' was not found

**URL:** <https://forum.ansible.com/t/the-connection-plugin-libssh-was-not-found/7661>\
**Category:** Get Help\
**Tags:** pylibssh, playbook, collections, galaxy-ng\
**Created:** [August 6, 2024, 8:13am UTC](https://forum.ansible.com/t/the-connection-plugin-libssh-was-not-found/7661 "2024-08-06T08:13:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![batchenr](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/batchenr/32/7123_2.png) [@batchenr](https://forum.ansible.com/u/batchenr)\
**Post date:** [August 6, 2024, 8:13am UTC](https://forum.ansible.com/t/the-connection-plugin-libssh-was-not-found/7661/1 "2024-08-06T08:13:05Z")

</div>

Im trying to work with ansible-libssh instead of paramiko because with paramiko i have alot of issues of disconnection of ssh, so i wanted to try libssh  
but i was not able to use it as i get the error  
`the connection plugin 'libssh' was not found` when runing a playbook.

ansible --version

```auto
ansible [core 2.17.2]
  config file = /Users/batchenr/ansible.cfg
  configured module search path = ['/Users/batchenr/venv/lib/python3.10/site-packages/ansible/modules']
  ansible python module location = /Users/batchenr/venv/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/batchenr/venv/lib/python3.10/site-packages/ansible_collections
  executable location = /Users/batchenr/venv/bin/ansible
  python version = 3.10.8 (v3.10.8:aaaf517424, Oct 11 2022, 10:14:40) [Clang 13.0.0 (clang-1300.0.29.30)] (/Users/batchenr/venv/bin/python)
  jinja version = 3.1.2
  libyaml = True

```

my settings:

- inventory file :

```auto
 [servers:vars]
ansible_user=user
ansible_ssh_private_key_file=~/.ssh/id_rsa.user.user
ansible_ssh_retries=3
ansible_connection=libssh

 [servers]
ansible_host= x.x.x.x
ansible_become_pass= xxx

```

ansible.cfg:

```auto
[defaults]
transport = libssh

[libssh_connection]
ssh_type = libssh
host_key_auto_add = False
ssh_args = -C -o ControlMaster=auto -o ControlPersist=600s
control_path = /dev/shm/cp%%h-%%p-%%r
timeout = 1600
pipelining = True

[persistent_connection]
ssh_type = libssh
command_timeout=1200
connect_timeout=600

```

ansible-galaxy collection list  
`ansible.netcommon 6.1.3`

pip freeze | grep ansible

```auto
ansible==10.2.0
ansible-core==2.17.2
ansible-pylibssh==1.2.2

```

im runing on Macos with venv  
also i have made sure libssh is installed:

brew install libssh  
libssh 0.10.6 is already installed and up-to-date.  
What am i missing?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 6, 2024, 8:34am UTC](https://forum.ansible.com/t/the-connection-plugin-libssh-was-not-found/7661/2 "2024-08-06T08:34:05Z")

</div>

The connection plugin is called `ansible.netcommon.libssh`, not simply `libssh`. (Short names only exist for plugins/modules that already were part of Ansible 2.9. The `libssh` connection plugin was added to ansible.netcommon 1.1.0, and thus was not moved there from Ansible 2.9.)

Try `ansible_connection=ansible.netcommon.libssh`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 5, 2024, 8:34am UTC](https://forum.ansible.com/t/the-connection-plugin-libssh-was-not-found/7661/3 "2024-09-05T08:34:42Z")

</div>

Closed on September 5, 2024, 8:34am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
