Ways to Uninstall or Install sshpass Ubuntu 22.04

Updated: October 6, 2022

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. In this guide, I will show you ways to install sshpass Ubuntu 22.04.

Software Requirement

  • Operating system: Ubuntu 22.04 is needed for sshpass to work
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install sshpass on Ubuntu 22.04

Install sshpass Ubuntu 22.04

sshpass is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install sshpass using APT

This is a popular method for installing any Ubuntu packages because it is simple to understand, even if you are a Linux beginner. Following these steps to install sshpass on your Ubuntu 22.04.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can install sshpass Ubuntu by executing this command in the terminal.

sudo apt -y install sshpass

Install sshpass using Aptitude

With Aptitude, users can view a list of available packages and manage their installation, upgrade, and removal of packages. If you didn’t install it on Ubuntu, you need to install it by executing this command.

sudo apt-get install aptitude

After that, you can now install sshpass, just following these steps:

Step 1: Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can install sshpass Ubuntu by pasting this command into the terminal and executing it.

sudo aptitude -y install sshpass

Uninstall sshpass on Ubuntu 22.04

Have you ever thought about how difficult it is to uninstall an application from Ubuntu? You are mistaken; anyone can easily uninstall any program, not just a package.

You can uninstall sshpass Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove sshpass

To uninstall sshpass and remove its data and dependencies, you can also use the following command:

sudo apt autoremove --purge sshpass

Summary

In this guide, I showed you ways to install sshpass on Ubuntu 22.04 and ways to uninstall sshpass too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.