Create a gist now

Instantly share code, notes, and snippets.

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
@adaptabi

brew install https://raw.github.com/eugeneoden/homebrew/eca9de1/Library/Formula/sshpass.rb
fails

$ brew install https://raw.github.com/eugeneoden/homebrew/eca9de1/Library/Formula/sshpass.rb
######################################################################## 100.0%
==> Downloading http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpa
Already downloaded: /Library/Caches/Homebrew/sshpass-1.05.tar.gz
Warning: MD5 support is deprecated and will be removed in a future version.
Please switch this formula to SHA1 or SHA256.
Error: MD5 mismatch
Expected: c52d65fdee0712af6f77eb2b60974ac7
Actual: 687fc45d732e5c45b5830e63f647e978
Archive: /Library/Caches/Homebrew/sshpass-1.05.tar.gz
To retry an incomplete download, remove the file above.
@victorbstan

brew install https://raw.github.com/eugeneoden/homebrew/eca9de1/Library/Formula/ss

################################################################## 100.0%

==> Downloading http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz

################################################################## 100.0%

Warning: MD5 support is deprecated and will be removed in a future version.
Please switch this formula to SHA1 or SHA256.

@arunoda
Owner
arunoda commented May 5, 2015

Thanks @kadwanev
Updated.

@tawanda
tawanda commented Sep 18, 2015

Thanks mate

@gil-andre

On Mac OS X "El Capitan" (version 10.11.3 15D21), sshpass can be compiled with "./configure ; make ; sudo make install" provided xcode and command-line tools are installed first.

@neuwirthe

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

will create a formula which you then can use normally as

brew install sshpass

@qunwang6

how to build for ios?

@judge2020

@qunwang6 considering you install both terminal and command-line utilities for iOS, "./configure ; make ; sudo make install" should work since iOS is still unix-based.

@fredlo2010

How can I uninstall if I installed it using the source code ?

@lukesUbuntu

Just use brew
$brew install http://git.io/sshpass.rb

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