Port knocking is a security technique used to secure servers. Connection is attempted to a sequence of ports to open or close an application/service port.
UFW (Uncomplicated Firewall) is available on all recent Ubuntu versions.
knockd installation:
apt install knockd
knockd configuration file:
/etc/knockd.conf
[options] UseSyslog [SSH] sequence = 7000,8000,9000…