Skip to content

Instantly share code, notes, and snippets.

@arunoda
Last active February 16, 2024 14:05
Show Gist options
  • Save arunoda/7790979 to your computer and use it in GitHub Desktop.
Save arunoda/7790979 to your computer and use it in GitHub Desktop.
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

Installing on OS X is tricky, since there is no official build for it. Before you get started, you need install xcode and command line tools.

Installing with Homebrew

Homebrew does not allow you to install sshpass by default. But you can use the following unofficial brew package for that.

brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb

Installing from the Source

  • Download the Source Code
  • Extract it and cd into the directory
  • ./configure
  • sudo make install
@mmaniga
Copy link

mmaniga commented Jun 16, 2021

works

brew install esolitos/ipa/sshpass

This works

@u0x01
Copy link

u0x01 commented Jan 2, 2022

@rlam3 didn't working on Apple Silicon:

curl: (35) error:06FFF089:digital envelope routines:CRYPTO_internal:bad key length
Error: sshpass: Failed to download resource "sshpass"
Download failed: https://downloads.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz

@esolitos
Copy link

esolitos commented Jan 2, 2022

@u0x01 I do not own a M1 mac, but from your it seems to be a simple curl https error. 🤔

CRYPTO_internal:bad key length

@pukelilu
Copy link

@esolitos Good stuff,
brew tap esolitos/ipa
brew install esolitos/ipa/sshpass

Worked like a charm.
Cheers

@esolitos
Copy link

I just updated to sshpass 1.09 and added a very simple test to ensure the installation of sshpass, since a few comments reported a failure in installing.

@timtorChen
Copy link

@u0x01 M1 user here, update to macOS Monterey 12.3 and the curl issue is solved.
I successfully install the sshpass.

@upbeta01
Copy link

upbeta01 commented Apr 22, 2022

Confirmed, that upgrading to Monterey 12.3 from 12.1 solved the issue.

@klin111
Copy link

klin111 commented Jul 22, 2022

good

@MrSitnikov
Copy link

On macos ventura 13 installation error: Error: Your Command Line Tools (CLT) does not support macOS 13.

@esolitos
Copy link

@MrSitnikov Did you follow this step?

[..] Before you get started, you need install xcode and command line tools.

@MrSitnikov
Copy link

@esolitos Yes, it is installed, but the version is 14.0.1, not 14.1 and is not updated, it says that the latest version is installed

@sprive
Copy link

sprive commented Aug 16, 2023

"[Brew] won't add sshpass because it makes it too easy for novice SSH users to
ruin SSH's security.
"

...and on that point, Brew still package tools like hping, nping and expect which allow novices to weaken security, or attack others. These are just tools.

What about the major use case of needing to SSH into an embedded device that doesn't support SSH keypairs? If your task is to automate (Ansible or shell scripts) against embedded systems, the loudest message Homebrew sends is: "Don't use a Mac for this, use Linux."

What this causes is Homebrew users pulling in "random" Github repos. At some point one of those rando repos will do something nasty to all these "novice users". Brew maintainers can claim it wasn't their doing, not everyone will feel that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment