Installing sshpass on OS X

Note: To install sshpass you need to make sure you have Xcode installed along with the Xcode command line tools.  You can download Xcode from the app store, and then install the command line tools from Xcode’s Preferences.

Now open up your terminal and run the following commands.

Download sshpass from source forge.

curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.05/sshpass-1.05.tar.gz

Extract the tarball and cd into the directory.

tar zxvf sshpass-1.05.tar.gz && cd sshpass-1.05

make and install.

./configure
make
sudo make install

Now test and make sure it works

sshpass -V

You should receive the following.

sshpass 1.05 (C) 2006-2011 Lingnu Open Source Consulting Ltd.
This program is free software, and can be distributed under the terms of the GPL
See the COPYING file for more information.