The port number of 1:netstat-ANP | grep is as follows. I take 3306 as an example, netstat-anp|grep3306 (if it is an ordinary user operation, add sudo, if it is a root user operation, you can view it without sudo). If there is no monitoring wire, it means it is not occupied. 2: netstat-Nultp (there is no need to add a port number here.
How does linux open and close ports?
First, check which ports netstat-anp has opened. Second, close the port number: iptables-a input-ptcp-drop port number -jdropptitables-aoutput-ptcp-dport port number-jdrop. Third, open the port number: iptables-a input-ptcp-dport port number -jACCEPT. Four, the following is the use of linux open port command. NC-LP23 (telnet) netstat-an | grep23 (check whether to open port 23) V. linux open port command Each open port needs a corresponding listener to suit the learning path of entry. Please read "This is how Linux should learn".
How to check which ports are located in listening state under Linux?
Use the netstst command to view the ports in listening state:
1, netstat-nupl//n/n indicates that the port number is displayed in digital form, u indicates the UDP protocol type, p indicates the program PID, and l indicates that it is in listening state;
2.netstat-nuplf|grep3306// This means that the process with port number 3306 is located in listening state.
What are the commands of linux open port?
First, check which ports netstat-anp has opened. Second, close the port number: iptables-a input-ptcp-drop port number -jdropptitables-aoutput-ptcp-dport port number-jdrop. Third, open the port number: iptables-a input-ptcp-dport port number -jACCEPT. Four, the following is the use of linux open port command. Nc-lp23 (open port 23, telnet)netstat-an|grep23 (check whether to open port 23) V. linux open port command Each open port needs a corresponding listener.
Does linux check whether the port of ntp server is open?
NTP is a service for synchronizing computer time. It is managed by ntpd service in linux. Under the condition that the ntpd service is started normally, the NTP service will synchronize the time through UDP 123 port. You can use the following command to check the port occupancy:
Ss-unlp|grepntp, if there is an echo, the port displays 123, indicating that the ntp service port has been opened.