How To Install knockd on Ubuntu 20.04
Introduction
In this tutorial we learn how to install knockd on Ubuntu 20.04.
What is knockd
knockd is:
A port-knock server that listens to all traffic on a given network interface (only Ethernet and PPP are currently supported), looking for a special “knock” sequences of port-hits. A remote system makes these port-hits by sending a TCP (or UDP) packet to a port on the server. When the server detects a specific sequence of port-hits, it runs a command defined in its configuration file. This can be used to open up holes in a firewall for quick access.
Package: knockd Architecture: amd64 Version: 0.7-1ubuntu3 Priority: optional Section: universe/net Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Leo Antunes [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 101 Depends: libc6 (>= 2.4), libpcap0.8 (>= 0.9.8), logrotate, lsb-base (>= 3.0-6) Filename: pool/universe/k/knockd/knockd_0.7-1ubuntu3_amd64.deb Size: 24836 MD5sum: 810b861eb83836dd9a0900e84cd09de1 SHA1: 48157048e823a9f79282b0b5558a6f3f0e9c1d10 SHA256: bb10bc22b05b782161a47e06322a59dc0d21cb884976b71f3919b65d5eddc866 Homepage: http://www.zeroflux.org/projects/knock Description-en: small port-knock daemon A port-knock server that listens to all traffic on a given network interface (only Ethernet and PPP are currently supported), looking for a special “knock” sequences of port-hits. A remote system makes these port-hits by sending a TCP (or UDP) packet to a port on the server. When the server detects a specific sequence of port-hits, it runs a command defined in its configuration file. This can be used to open up holes in a firewall for quick access.
There are three methods to install knockd on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install knockd Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install knockd using apt-get by running the following command:
sudo apt-get -y install knockd
Install knockd Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install knockd using apt by running the following command:
sudo apt -y install knockd
Install knockd Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install knockd using aptitude by running the following command:
sudo aptitude -y install knockd
How To Uninstall knockd on Ubuntu 20.04
To uninstall only the knockd package we can use the following command:
sudo apt-get remove knockd
Uninstall knockd And Its Dependencies
To uninstall knockd and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove knockd
Remove knockd Configurations and Data
To remove knockd configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge knockd
Remove knockd configuration, data, and all of its dependencies
We can use the following command to remove knockd configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge knockd
References
Summary
In this tutorial we learn how to install knockd package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.