Firewall
- Ubuntu
Firewall Configuration
Please follow this step-by-step guide, to configure the firewall
-
Gain access to root shell
sudo -i
-
Before enabling firewall, make sure to provide access to the ssh port
ufw allow ssh
-
Make sure to allow outgoing connections
ufw default allow outgoing
-
Block all incoming connection except ssh by default
ufw default deny incoming
-
Due to security concerns, close port 22 in the ufw firewall
sudo ufw delete allow 22/tcp
-
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
-
Reload the firewall
sudo ufw reload