📌  相关文章
📜  ANSIBLE ubuntu "要使用带密码的 'ssh' 连接类型,必须安装 sshpass 程序 - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:39:15.098000             🧑  作者: Mango

ANSIBLE ubuntu "要使用带密码的 'ssh' 连接类型,必须安装 sshpass 程序 - Shell-Bash

如果您使用 Ansible 连接到远程服务器,而需要用到带密码的 'ssh' 连接类型,那么必须安装 'sshpass' 程序。这个程序可以使您不必手动输入远程服务器的密码,从而使连接变得更加简单和顺畅。

下面是 Ubuntu 操作系统中安装 'sshpass' 的方法:

  1. 打开终端,运行命令 sudo apt-get update ,更新您的系统

  2. 运行命令 sudo apt-get install sshpass ,安装 'sshpass' 程序

  3. 程序安装完成后,您可以使用以下命令测试 'sshpass' 的安装情况:

sshpass -V

您应该看到类似于以下文本的输出:

sshpass 1.06 (c) 2006-2011 Lingnu Open Source Consulting Ltd.
This program is free software, and can be distributed under the terms of the GPL. See the COPYING file for more information.

现在,您已经成功安装了 'sshpass' 程序,并且可以在 Ansible 中使用带密码的 'ssh' 连接了。