# Ansible 提示 sshpass 错误

**URL:** <https://www.isharkfly.com/t/ansible-sshpass/15644>\
**Category:** DevOps\
**Tags:** ansible\
**Created:** [April 16, 2024, 4:09pm UTC](https://www.isharkfly.com/t/ansible-sshpass/15644 "2024-04-16T16:09:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [April 16, 2024, 4:09pm UTC](https://www.isharkfly.com/t/ansible-sshpass/15644/1 "2024-04-16T16:09:27Z")

</div>

错误的信息为：

```auto
AILED! => {"msg": "to use the 'ssh' connection type with passwords or pkcs11_provider, you must install the sshpass program"}

```

## 问题和原因

这是在运行 ansible 的服务器需要安装 sshpass 组件。

可以直接运行：

```auto
[root@devops ~]# dnf install sshpass

```

来进行安装。

 ![2024-04-16_12-08-49](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/2/216b6928485bc53a1ca68c7cee0a54636dfd92cf.png)

如上图所示，就可以解决 ansible 安装提示的错误。
