-Bash-3.00 # netstat-TLN
The netstat-TLN command is used to view Linux port usage.
/Etc/init. d/vsftp start is used to start the ftp port ~!
View files/etc/services
Netstat
View the connected service port (established)
Netstat-
View All service ports (Listen, established)
Sudo netstat-AP
View All service ports and display corresponding servicesProgramName
NMAP <scan type> <scan parameters>
For example:
NMAP localhost
NMAP-P 1024-65535 localhost
NMAP-Pt 192.168.1.127-245
When we use netstat-APN to view network connections, we will find a lot similar to the following:
PROTO Recv-Q send-Q local address foreign address State PID/program name
TCP 0 52 218.104.81.152: 7710 211.100.39.250: 29488 established 6111/1
It indicates that port 7710 is opened on this server. Which program does this port belong? We can use the lsof-I: 7710 command to query:
Command PID user FD type device size node name
Sshd 1990 root 3u IPv4 4836 tcp *: 7710 (Listen)
In this way, we know that port 7710 belongs to the sshd program.