Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Install sshpass for Ansible 2.3.1 on macOS 10.11 #21

Closed
chusiang opened this issue Jun 16, 2017 · 2 comments
Closed

Install sshpass for Ansible 2.3.1 on macOS 10.11 #21

chusiang opened this issue Jun 16, 2017 · 2 comments
Assignees

Comments

@chusiang
Copy link
Member

chusiang commented Jun 16, 2017

I need install the sshpass for control managed nodes with passwords, but the homebrew default can't find this package.

$ ansible --version
ansible 2.3.1.0
  config file = /Users/jonny/vcs/foo.ansible.role/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Dec 17 2016, 23:03:43) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

Before 2.3.0, I didn't need installed the sshpass, but now it's not working. 😢

$ ansible all -m ping
server1 | FAILED! => {
    "failed": true,
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}

We can't install the sshpass with homebrew by default.

$ brew search sshpass
We won't add sshpass because it makes it too easy for novice SSH users to
ruin SSH's security.

Manual create a sshpass formula of homebrew.

$ brew create https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz --force

Install it !

$ brew install sshpass
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from fd333392 to 3fe32053.
Updated 2 taps (caskroom/cask, homebrew/core).
==> Updated Formulae
archi-steam-farm     docutils             libbluray            ndpi                 prometheus
aws-sdk-cpp          druid                luvit                node ✔               s6
cockroach            fd                   msgpack ✔            node-build           translate-toolkit

==> Using the sandbox
==> Downloading https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
Already downloaded: /Users/jonny/Library/Caches/Homebrew/sshpass-1.06.tar.gz
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/sshpass/1.06
==> make install
🍺  /usr/local/Cellar/sshpass/1.06: 9 files, 42.6KB, built in 7 seconds

Finally, it's working, now !!! 😎

$ ansible all -m ping
server1 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

Reference

@chusiang
Copy link
Member Author

chusiang commented Apr 30, 2020

I can't make install the sshpass v1.06 on macOS v10.15.4, so I copy the binary from macOS v10.11.6. It's working now.

sshpass-1.06.zip

md5sum.

[ chusiang@unicorn ~ ] - 11:51
$ md5 sshpass sshpass-1.06.zip
MD5 (sshpass) = 6bbdf91b8c8fad7159a77de733a1a1eb
MD5 (sshpass-1.06.zip) = dd0c84144fcc75d6046a5627812da89d

sha256 checksum:

[ chusiang@unicorn ~ ] - 11:51
$ shasum -a 256 sshpass sshpass-1.06.zip
550b5ae614a4b0b5db7141a71908a2ef1f7dd74a753301e26668531d1beb8b0a  sshpass
0735cf3bfcc599c2da6427d4d6cee9e871535dd31bd9eea7e6bd21051661619a  sshpass-1.06.zip

@shirishshukla
Copy link

brew install --build-from-source sshpass

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants