One of the important steps in maintaining a server is to manage the opening and closing of ports to avoid running out of services, and external malicious attacks exploit the ports occupied by those services.
The first step is to be able to view iptables:
sudo iptables -Lwill list each rule. The rule labeled ACCEPT means that the communication indicated by this rule can be successful. The rule labeled DROP refers to blocking the communication represented. It should be noted that in the system operation, the rules will be matched from the beginning to the end, so the last rule is DROP, indicating the end, and there can be no DROP in the middle, otherwise the subsequent ACCEPT will not work.
Adding rules:
# iptables -A INPUT -p tcp -i eth0 --dport ssh -j ACCEPT-A means append, -p tcp means tcp protocol, -i Eth0 indicates the network card, --dport ssh indicates the port ssh (that is, 22), and -j ACCEPT indicates that the rule is ACCEPT. If we want to open the 9001 port, we will replace ssh with 9001.
Delete rule:
# iptables -D INPUT 33 means the third The rule is the one listed above with iptables -L. The first line is the first rule.
Our last one is DROP, so block communication:
# iptables -A INPUT -j DROP
using direct-lvm storage method Recently played docker on Bluemix virtual machine, but found that t
Today, I will share 11 cool Linux terminal commands compiled by Linux for ten years. Through
There are 7 startup levels in Linux: #0 - halt (Do NOT set initdefault to this)# 1 - Single
Cause The application is deployed into the virtual pool, and the virtual machine is missing the gcc
Linux environment variable settings file
Ubuntu LAN uses client networking
Real-time automatic backup of switch configuration files every day with Linux server
Linux study notes - shutdown and restart command
Linux lftp connection ftp server upload download command
Quick access and common commands on Mysql on Linux
Under Linux, how can ordinary users temporarily obtain root privileges?
TomcatVM parameter modification under Linux
Linux Vi editor code highlighting and permanent display line number scheme
Teach you how to easily set the win8 account password
How to properly use the built-in sound card USB speaker under Win7
Windows 7 Installation Frequently Asked Questions
What should I do if the Win8 computer can't boot into the system?
How to automatically open the webpage marked with Bing after Win8.1 broadband connection
How to convert ISO to esd format? Win10 system image esd format converted to ISO format method
Two tricks let Windows Task Manager no longer strike
Have to wait, Opera browser ignores WP8 platform