How To Install autossh on Kali Linux

In this tutorial we learn how to install autossh on Kali Linux. autossh is Automatically restart SSH sessions and tunnels

Introduction

In this tutorial we learn how to install autossh on Kali Linux.

What is autossh

autossh is:

autossh is a program to start an instance of ssh and monitor it, restarting it as necessary should it die or stop passing traffic. The idea is from rstunnel (Reliable SSH Tunnel), but implemented in C. Connection monitoring is done using a loop of port forwardings. It backs off on the rate of connection attempts when experiencing rapid failures such as connection refused.

There are three methods to install autossh on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install autossh Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install autossh using apt-get by running the following command:

sudo apt-get -y install autossh

Install autossh Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install autossh using apt by running the following command:

sudo apt -y install autossh

Install autossh Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install autossh using aptitude by running the following command:

sudo aptitude -y install autossh

How To Uninstall autossh on Kali Linux

To uninstall only the autossh package we can use the following command:

sudo apt-get remove autossh

Uninstall autossh And Its Dependencies

To uninstall autossh and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove autossh

Remove autossh Configurations and Data

To remove autossh configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge autossh

Remove autossh configuration, data, and all of its dependencies

We can use the following command to remove autossh configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge autossh

Dependencies

autossh have the following dependencies:

References

Summary

In this tutorial we learn how to install autossh package on Kali Linux using different package management tools: apt, apt-get and aptitude.