How to install sshpass on macOS / OS X

How to install sshpass on macOS / OS X

To install sshpass, a popular open-source tool for non-interactively performing password authentication with ssh, on macOS or OS X, follow these steps:

  1. Install the homebrew package manager by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Source:ww‮uttual.w‬ri.com
  1. Install sshpass by running the following command:
brew install sshpass

This will install sshpass and any dependencies required.

  1. To verify that the installation was successful, run the following command:
sshpass -V

This will display the version of sshpass that was installed.

  1. To use sshpass, run a command similar to the following:
sshpass -p 'password' ssh user@host

Replace password with the password for the ssh connection, user with the username, and host with the hostname or IP address of the server.

Sshpass will non-interactively perform password authentication with ssh, allowing you to connect to the server without being prompted for a password.

That's it! Sshpass is now installed on your macOS or OS X system and ready to use. Please note that using sshpass to automate password authentication with ssh is generally considered a security risk and should be used with caution.

Created Time:2017-10-16 14:38:50  Author:lautturi