[Open ports and close firewall in kalilinux] Detailed tutorial

First, let’s update the following kali source so that we can install the ufw command later.

apt-get update         #获取更新包/更新软件  

Of course, if you don’t have a source change or update source, you can read my kali Linux update source tutorial for detailed instructions on updating the source.

Next we start teaching.

First you need to install the ufw command

apt-get install ufw

Then after the installation is completed, we can directly enter the instructions. I will not give you more demonstrations below.

Examples of using the ufw command are as follows:

  • Check the status of the firewall (default inactive)
ufw status
  • Firewall version
ufw version
  • Start ufw firewall
ufw enable
  • Turn off ufw firewall
ufw disable
  • Access to all is disabled by default
ufw default deny
  • Open port 22/TCP
ufw allow 22/tcp
  • Open port 80 (tcp/udp)
ufw allow 53
  • No external access
ufw deny 3306
  • Delete rules that have been added
ufw delete allow 22
  • Allow this IP to access all local ports
ufw allow from 192.168.1.100
  • Delete the above rule
ufw delete allow from 192.168.1.100
  • Disable access to port 8888
 ufw deny 8888
  • Open port 22 for tcp requests from 192.168.0.1
ufw allow proto tcp from 192.168.0.1 to any port 22

The above are all the methods about port switching. If there are any new ones, you can add them.

Guess you like

Origin blog.csdn.net/2302_78587828/article/details/132780974