Skip to main content

Firewall

Firewall Configuration

Please follow this step-by-step guide, to configure the firewall

  1. Gain access to root shell

    sudo -i
  2. Before enabling firewall, make sure to provide access to the ssh port

    ufw allow ssh
  3. Make sure to allow outgoing connections

    ufw default allow outgoing
  4. Block all incoming connection except ssh by default

    ufw default deny incoming
  5. Due to security concerns, close port 22 in the ufw firewall

    sudo ufw delete allow 22/tcp
  6. Turn on the firewall

    ufw enable

    It might show a prompt like this:

    Command may disrupt existing ssh connections. Proceed with operation (y|n)?

    Type "y" and enter to confirm the operation

  7. Reload the firewall

    sudo ufw reload