Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@dhtml
Copy link

dhtml commented Oct 4, 2020

MAC OSX Catalina
Version: 10.15.6

brew tap esolitos/ipa
brew install sshpass
Gave me an empty installation.

However, this one below works
$ brew install esolitos/ipa/sshpass

Thanks

@fgardavaud
Copy link

fgardavaud commented Oct 13, 2020

Install failed same to previous users with the recommended command line :
brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb

Error: Calling Non-checksummed download of sshpass formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead.

But @esolitos 🥇 save my working day. Thank you very much for your work.
this command line work for me (macOS 10.15.7, no choice in a new mac 👎 )
$ brew install esolitos/ipa/sshpass

@esolitos
Copy link

esolitos commented Oct 16, 2020

Interesting, it's 2 people which had the same issue. I opened an issue report: esolitos/homebrew-ipa#1

Would be nice if @dhtml and @davidcsi could help me out there.
You could check if you have multiple taps providing the same formula.

@alozano-77
Copy link

alozano-77 commented Oct 17, 2020

@esolitos jumping in and tried your solution with a new error

brew tap esolitos/ipa
brew install sshpass

Error: Permission denied @ apply2files - /usr/local/lib/node_modules/serverless/node_modules/term-size/vendor/macos/.DS_Store

Edit: seems like it didn't cause any problems. Trying to retap and install results in Warning: esolitos/ipa/sshpass 1.06 is already installed and up-to-date so likely good to go. Thanks for the help

@esolitos
Copy link

esolitos commented Oct 17, 2020

@dhtml
Copy link

dhtml commented Oct 17, 2020

I support using brew doctor, I never ran into this type of error.

Let me run this again right now, Now I am on Mac OSX Catalina, 10.15.7

tony@Cathy ~ % brew uninstall sshpass
Uninstalling /usr/local/Cellar/sshpass/1.06... (9 files, 78.0KB)
tony@Cathy ~ % brew install sshpass
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask-versions).
==> Updated Casks
affinity-designer-beta

==> Downloading https://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
==> Downloading from https://liquidtelecom.dl.sourceforge.net/project/sshpass/sshpass/1.05/sshpass-1.05.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sshpass/1.05
Error: Empty installation
tony@Cathy ~ % brew install esolitos/ipa/sshpass
==> Installing sshpass from esolitos/ipa
==> Downloading https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
Already downloaded: /Users/tony/Library/Caches/Homebrew/downloads/53e23c753c814ca762621b4d0e73b5fc21ff548e7b31d38ef31d9a7d8ca6eee0--sshpass-1.06.tar.gz
==> ./configure --prefix=/usr/local/Cellar/sshpass/1.06
==> make install
🍺 /usr/local/Cellar/sshpass/1.06: 9 files, 78.0KB, built in 11 seconds
Removing: /Users/tony/Library/Caches/Homebrew/sshpass--1.05.tar.gz... (96KB)

Let me show of my environment variables:
tony@Cathy ~ % node -v
v14.12.0
tony@Cathy ~ % npm -v
6.14.8
tony@Cathy ~ % sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H2

@esolitos
Copy link

esolitos commented Oct 17, 2020

@dhtml
Copy link

dhtml commented Oct 18, 2020

Okay here is the tap:
tony@Cathy ~ % brew tap
esolitos/ipa
exolnet/deprecated
heroku/brew
homebrew/cask
homebrew/cask-versions
homebrew/core
homebrew/services

tony@Cathy ~ % brew --version
Homebrew 2.5.6-67-gaa97179
Homebrew/homebrew-core (git revision a5a91; last commit 2020-10-17)
Homebrew/homebrew-cask (git revision a9119; last commit 2020-10-17)

@tdubb123
Copy link

tdubb123 commented Oct 23, 2020

I am getting error install on osx

brew install http://git.io/sshpass.rb
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.

Error: Calling Non-checksummed download of sshpass formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead.
twong@NAR33051M vmware %

@DanBurkhardt
Copy link

DanBurkhardt commented Oct 23, 2020

Hello all. I have made a Gist with a script that includes everything you need, commented above.

Give it a go:
Install "sshpass" on macOS Catalina with my gist: install-sshpass.sh

@YoungJaeChoung
Copy link

YoungJaeChoung commented Oct 25, 2020

The below code works for me
which is solution of 'shiramy'
from
https://stackoverflow.com/questions/32255660/how-to-install-sshpass-on-mac

brew install esolitos/ipa/sshpass

@JinAirsOs
Copy link

JinAirsOs commented Nov 21, 2020

The below code works for me
which is solution of 'shiramy'
from
https://stackoverflow.com/questions/32255660/how-to-install-sshpass-on-mac

brew install esolitos/ipa/sshpass

works for me too!

@alexeynikolayev
Copy link

alexeynikolayev commented Nov 26, 2020

solution of 'shiramy' is giving a error on last Catalina for me

==> Installing sshpass from esolitos/ipa
==> Downloading https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/53e23c753c814ca762621b4d0e73b5fc21ff548e7b31d38ef31d9a7d8ca6eee0--sshpass-1.06.tar.gz
==> ./configure --prefix=/usr/local/Cellar/sshpass/1.06
==> make install
Last 15 lines from /Users/user/Library/Logs/Homebrew/sshpass/02.make:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:216:2: error: unknown type name 'uint64_t'
        uint64_t ri_wired_size;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:217:2: error: unknown type name 'uint64_t'
        uint64_t ri_resident_size;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:218:2: error: unknown type name 'uint64_t'
        uint64_t ri_phys_footprint;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:219:2: error: unknown type name 'uint64_t'
        uint64_t ri_proc_start_abstime;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [main.o] Error 1

@yihuiluo235
Copy link

yihuiluo235 commented Dec 8, 2020

$ brew tap esolitos/ipa
$ brew install sshpass
it works

@Master-cai
Copy link

Master-cai commented Dec 22, 2020

Hi @rjmaomao, you can try using the tap i created for this:

If anybody cares i created a brew tap to provide it:

$ brew tap esolitos/ipa
$ brew install sshpass

Done.

Hi @esolitos , I didn't expect to receive an answer so quickly, thank you very much. I found an article from google mentioned following tap, tried it and worked. I guess should be same as the tap you created? May I ask how can I upgrade sshpass if I installed it through tap and there's new version ?

Some years have passed and there is now a proper Homebrew Tap for sshpass, maintained by Aleks Hudochenkov. To install sshpass from this tap, run: brew install hudochenkov/sshpass/sshpass

thanks! it works. brew install hudochenkov/sshpass/sshpass

@moomdate
Copy link

moomdate commented Dec 25, 2020

esolitos/ipa/sshpass

it work /\

@GuilhermeDSantos
Copy link

GuilhermeDSantos commented Jan 8, 2021

It didn't work for me...
image

@zethzeth
Copy link

zethzeth commented Feb 7, 2021

I wish Thumbs-Up wasn't disabled, so one could find the one(s) that works quicker.

This one worked for me: https://gist.github.com/arunoda/7790979#gistcomment-3569821

@DanBurkhardt
Copy link

DanBurkhardt commented Feb 19, 2021

I wish Thumbs-Up wasn't disabled, so one could find the one(s) that works quicker.

This one worked for me: https://gist.github.com/arunoda/7790979#gistcomment-3569821

here m8: https://gist.github.com/arunoda/7790979#gistcomment-3501587

@rlam3
Copy link

rlam3 commented May 26, 2021

works

brew install esolitos/ipa/sshpass

@Mugilan-Codes
Copy link

Mugilan-Codes commented Jun 1, 2021

Is there no official one for sshpass ?

@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

pukelilu commented Jan 20, 2022

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

Worked like a charm.
Cheers

@esolitos
Copy link

esolitos commented Feb 18, 2022

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

timtorChen commented Mar 15, 2022

@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

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