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.
Linux view available ports?
The port number of service port in TCP/IP protocol ranges from 0 to 65535, but it is limited in Linux. Generally, the port range of local TCP/UDP is defined in/proc/sys/net/IPv4/IP _ local _ port _ range. You can define net. Ipv4.ip _ local _ port _ range =102465000 in /etc/sysctl.conf, and the available port range becomes 1024~65000.
How does linuxvsftp change the default port and access?
1. Edit the /etc/vsftpd/vsftpd.conf file and add this line to the configuration file: listen_port=8 1 1.
2. Edit the /etc/services file, change ftp2 1/tcp to FTP 81/TCP, and change FTP 2 1/UDP to FTP 81/TCP.
3. Execute /etc/init.d/vsftpdrestart to restart the vsftpd service. You can use netstat-tnulp|grepvsftpd after startup, and you can see that the port of vsftpd that the system is listening to now is 8 1 1.
4. Execute lftp192.168.5.1:801(192.168.5./yes, vsftpd.
How to query the current program accessing the network under linux?
First of all: netstat-ano can see the services that the port is running and the external connection of the port. Of course, iftop can be installed to accurately see the traffic of each IP. If the machine is running WEB services or related software, please use iftop to check the accessed IP, and then go to the log in apache to analyze which file is accessed.