Link: How To Configure Port Knocking Using Only IPTables on an Ubuntu VPS

Servers that are connected to the internet are subjected to all manners of attacks and probes by malicious users, scripts, and automated bots. It is sometimes a balancing act to secure your server from attacks without affecting legitimate access to your services and resources.

Certain types of services are meant to be visible and consumable to the public internet. An example of this is a web server. Other types of services are typically used by only the system administrator or a select number of individuals and are not meant to be a public resource.

A concept known as port knocking is a way of shielding processes that fit into the latter description. Port knocking works by covering the ports associated with a process behind a firewall until a specific, predetermined sequence of network activity occurs. At this point, the port knocking service reconfigures the firewall to allow access to the protected application.

Full article here:
How To Configure Port Knocking Using Only IPTables on an Ubuntu VPS (DigitalOcean)
Related:
How To Use Port Knocking to Hide your SSH Daemon from Attackers on Ubuntu (DigitalOcean)

Link: Port knocking: Enhance Security Using knockd and/or Iptables From Basics

Before moving into the article, let me tell you how this article has been written. This article starts with the introduction to knockd, and proceeds with the implementation of port knocking by using iptables. Note that the same port knocking can be achieved using knockd, as well, which will be discussed in the upcoming article.

Full article here:
Port knocking: Enhance Security Using knockd and/or Iptables From Basics (Unixmen)