sshpass command not found

In this troubleshooting guide we learn how to fix sshpass command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

sshpass: command not found

or when using sudo you get the following error message

sudo: sshpass: command not found

Solutions to sshpass: command not found

How To Fix sshpass: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu sshpass is provided by sshpass package.

sshpass is:

SSH’s (secure shell) most common authentication mode is called “interactive keyboard password authentication”, so called both because it is typically done via keyboard, and because openssh takes active measures to make sure that the password is, indeed, typed interactively by the keyboard. Sometimes, however, it is necessary to fool ssh into accepting an interactive password non-interactively. This is where sshpass comes in.

SECURITY NOTE: There is a reason openssh insists that passwords be typed interactively. Passwords are harder to store securely and to pass around securely between programs. If you have not looked into solving your needs using SSH’s “public key authentication”, perhaps in conjunction with the ssh agent (RTFM ssh-add), please do so before being tempted into using this package.

To fix this problem, we can install more using the command below.

sudo apt-get -y install sshpass

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install sshpass.

sudo apt -y install sshpass

Or if you have aptitude installed you can use the following command.

sudo aptitude install sshpass

Summary

In this tutorial we learn how to fix sshpass command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.