Preface In today's increasingly convenient Internet society, various Internet ransomware viruses emerge in an endless stream. Even Google browsers are constantly updating versions to fix vulnerabilities. Many people believe that only Windows systems are prone to viruses, and that Linux systems are not prone to viruses. They often leave their computers running without installing antivirus software or turning on a firewall. In fact, it is possible to get viruses under Linux, but those viruses can hardly run automatically like they do under Windows. The characteristics of Linux determine that in many cases you need to give root permissions to the software to run. This does greatly reduce the chance of the computer getting a virus. But no matter whether your Linux system is Ubuntu or other distributions, even if you don’t install anti-virus software, the firewall must be turned on. Unfortunately, many of us have the firewall turned off on our computers. Today’s blog mainly teaches you how to turn on the firewall of the Ubuntu system to prevent important computer files from being stolen. 1. Installation Ubuntu 20.04 generally has UFW (Uncomplicated Firewall) installed by default. It is a lightweight tool that is mainly used to monitor input and output traffic. If it is not installed, install it using the following command: sudo apt install ufw Normally, after installation, the system should be disabled by default. Enter the This means the firewall is not enabled. Enable it below. 2. Enable Enter the following command in the terminal: sudo ufw enable sudo ufw default deny After running the above two commands, the firewall is enabled and automatically enabled when the system starts. Enter The above default configuration means closing all external access to the local machine, but the local machine can access the outside normally. At the same time, I have opened port 3690 to allow external access to the local machine through port 3690. Here, SVN uses port 3690 by default, so I can submit code to the local machine through SVN from the outside. 3. Enable/disable For general users, you only need to set the following three commands: sudo apt install ufw sudo ufw enable sudo ufw default deny It is safe enough. If you need to open certain services, use the sudo ufw allow | deny [service] Open or close a port, for example: sudo ufw allow 53 allows external access to port 53 (tcp/udp) sudo ufw allow 3690 allows external access to port 3690 (svn) sudo ufw allow from 192.168.1.111 allows this IP to access all local ports sudo ufw allow proto tcp from 192.168.0.0/24 to any port 22 allows the specified IP segment to access a specific port sudo ufw delete allow smtp delete a rule created above, for example, to delete the SVN port, you can use sudo ufw delete allow 3690 4. Enable/disable firewall sudo ufw enable | disable 5. Examples Here are some examples of ufw command lines: ufw enable/disable: Enable/disable ufw ufw status: View the defined ufw rules ufw default allow/deny: External access is allowed/denied by default ufw allow/deny 20: Allow/deny access to port 20, 20 can be followed by /tcp or /udp, indicating TCP or UDP packets. sudo ufw allow proto tcp from 192.168.0.0/24 to any port 22: Allows TCP packets from 192.168.0.0/24 to access port 22 of the local machine. ufw delete allow/deny 20: Delete the previously defined "allow/deny access to port 20" rule This is the end of this article about the simple tutorial on Ubuntu 20.04 firewall settings (for beginners). For more relevant Ubuntu 20.04 firewall settings content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: What you need to know about msyql transaction isolation
>>: Understand the principle of page replacement algorithm through code examples
<br />In the field of network design, resear...
In one sentence: Data hijacking (Object.definePro...
Introduction I will write about the problem I saw...
Solution to "Could not run curl-config"...
1. Download MySQL Workbench Workbench is a graphi...
1. Overview MySQL version: 5.6.21 Download addres...
Scenario: A laradock development environment (php...
Table of contents Environmental conditions Errors...
describe This article introduces a method to impl...
What is load balancing? When a domain name points...
As shown below: LOCATE(substr,str) Returns the fi...
1 Pull the image from hup docker pull nginx 2 Cre...
HTML forms are used to collect different types of...
Table of contents Tomcat class loader hierarchy W...
This article shares the MySQL 5.7.16 free install...