APF Linux Firewall Open Port 22 From Specific / Selected IP Address Only

‮sptth‬://www.lautturi.com
APF Linux Firewall Open Port 22 From Specific / Selected IP Address Only

To open port 22 (the default SSH port) on a Linux server running APF (Advanced Policy Firewall), you can follow these steps:

  1. Edit the /etc/apf/allow_hosts.rules file and add the following line, replacing x.x.x.x with the IP address that you want to allow connections from:
tcp:in:d=22:s=x.x.x.x
  1. Save and close the file, and then restart APF to apply the changes:
sudo service apf restart

After completing these steps, port 22 will be open and allowing incoming connections only from the specified IP address. You can verify this by trying to connect to the server using SSH from the allowed IP address.

Created Time:2017-10-16 14:29:17  Author:lautturi