Linux --- Ubuntu14.04 firewall configuration, ubuntu14 disable Firewall
Ubuntu14.04 Firewall Configuration
1. installation:
Apt-get install ufw
2. enable:
Ufw enable
Ufw default deny
3. enable/disable:
Ufw allow 22/tcp allows all external IP addresses to access the local port 22/tcp (ssh)
Ufw deny 22/tcp prohibit all external IP addresses from accessing the local port 22/tcp (ssh)
Ufw delete deny 22/tcp delete firewall rules
4. instance:
1) view the Local Firewall Status:
2) Enable Firewall:
Because I use ssh to connect to the server, When I enable the firewall, the system will ask if I want to confirm the operation. This command may disconnect the ssh connection.
3) add rules:
Add all external IP addresses to access port 22 rules based on TCP protocol:
Check the system firewall status and you will find that the rules have been added:
To add all external IP addresses, you can access port 123 over TCP:
Disable port 123:
Delete the rule for port 123:
Allow this IP address to access all local ports:
Delete the previous rule:
Disable Firewall: