Current location - Quotes Website - Collection of slogans - Linux process port occupies Linux process port.
Linux process port occupies Linux process port.
Linux check port command?

Commands for viewing ports on linux:

The first kind:

Lsof-i: port number

The second type:

Netstat-nltp|grep port number

-a: Displays all connection ports and listening ports of this machine.

-n: The form of network IP address, which shows the currently established valid connections and ports.

-r: display routing table information

-s: Display statistics by protocol.

-v: Displays the currently valid connections.

-t: display all TCP protocol connections.

-u: Show all UDP protocol connections.

-i: Displays the status of the auto-configuration port.

-l: Only the service network status with the connection status of monitoring is displayed.

-p: display pid/programname.

In AIX, which command can see which processes are using which port?

AIX has no command to directly check which process is using which port, unlike Linux, which can use lsof or netstat-p to check. At present, you can use the following methods to view:

1. First, use netstat to list the ports used. Please note that an extra parameter -A is required.

#netstat-Aan

f 100050002d 32 bb 8 TCP 600 * . 22 *。 * Listen

f 100050002d 3 138 btcp 400 * . 22 *。 * Listen to the example above and list the situation of port 22.

2. Use the command rmsock to check again. Note: This command is used to clear a socket without a related file descriptor. If the socket is occupied by a process, it will prompt which process the port is used by, and use this prompt information to obtain process information. take for example

# rmsockf 100050002d 3 13b 8 tcpcb

Socket 0xf10050002d31008 is implemented through process 5374084 (sshd). It shows that port 22 is occupied by process sshd (process number 5374084).

If you know that your operation will not affect the system, or just for testing, you can use the following loop to grab it:

netstat-anA | grep-wLISTEN | awk ' { print $ 1,$5}'|whilereadpcbport

do

echo"$port ->"

rmsock$pcbtcpcb

finished

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".

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.