1. 程式人生 > >you must install the sshpass program 解決方式

you must install the sshpass program 解決方式

安裝完ansible之後,使用的時候發生如下錯誤:

ansible 192.168.1.2 -i ./hosts -m shell -a "date"
192.168.1.2 | FAILED => to use the 'ssh' connection type with passwords, you must install the sshpass program

只需要安裝sshpass即可,CentOS系統的預設yum源裡面並沒有這個軟體,網上有資料說搜狐的yum源裡面有,有需要的讀者可以自行查閱。

這裡給出sshpass的原始碼安裝方式:

$ wget http:
//sourceforge.net/projects/sshpass/files/latest/download -O sshpass.tar.gz $ tar -xvf sshpass.tar.gz $ cd sshpass-1.06 $ ./configure $ sudo make install

本文參考內容: sshpass:一個很棒的免互動SSH登入工具,這篇文章裡面有sshpass比較詳細的介紹和使用方法。