How to: Open Ssh Port 22 on Linux APF Firewall under CentOS / RHEL

www.l‮uttua‬ri.com
How to: Open Ssh Port 22 on Linux APF Firewall under CentOS / RHEL

To open the SSH port (port 22) on a Linux system running the APF firewall, you will need to modify the firewall rules.

  1. Edit the APF configuration file:

The APF configuration file is typically located at /etc/apf/conf.apf. You will need to use a text editor to open the file and make the necessary changes.

  1. Locate the IG_TCP_CPORTS variable:

In the APF configuration file, locate the IG_TCP_CPORTS variable, which defines the incoming TCP ports that are allowed through the firewall.

  1. Add port 22 to the list of allowed ports:

To allow incoming SSH connections, add port 22 to the list of allowed ports. For example:

IG_TCP_CPORTS="21,22,25,80,110,143,443"
  1. Save the configuration file and restart the APF firewall:

After making the changes to the configuration file, save it and restart the APF firewall to apply the new rules. You can do this using the apf -r command:

apf -r

This will allow incoming SSH connections to be accepted by the firewall. You should now be able to connect to the system using an SSH client.

Keep in mind that these instructions are specific to the APF firewall, and may not apply to other firewall software. If you are using a different firewall, you will need to consult its documentation for information on how to open the SSH port.

Created Time:2017-10-29 22:08:42  Author:lautturi