In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to check the local open port list in Linux". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to check the local open port list in Linux" can help you solve the problem.
How to use the Linux command netstat to check the list of open ports in a system
It lists all tcp, udp connections, and all unix socket connections. It is used to discover network problems and determine the number of network connections.
Netstat-tplugnActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0 Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 25 0.0.0.0 only servers * LISTEN 2038/mastertcp 0 0 127.0.1 VR 199 0.0.0.0 Vol * LISTEN 1396/snmpdtcp 0 0 0 LISTEN 1388/sshdtcp6 80 0: 0 0 0. 0 LISTEN 1388/sshdtcp6 0 0:: 25:: * LISTEN 2038/mastertcp6 0 0: 22: * LISTEN 1388/sshdudp 0 0 0.0.0.0 1396/snmpdudp 39136 0.0.0.0 1396/snmpdudp 00 0.0.0.0 1396/snmpdudp 56130 0 .0.0.0: * 1396/snmpdudp 0 0 0.0.0.0 1396/snmpdudp 40105 0.0.0.0 1396/snmpdudp 0 0 0.0.0.0 30105 0.0.0.0 * 1396/snmpdudp 0 0 0.0.0.0.015 0656 0.0.0.015 * 1396/snmpdudp 0 0 0.0.0.015 1632 0.0.0.0 * 1396/snmpdudp 0 0 0.0.0.0 1396/snmpdudp 28265 0.0.0.0 1396/snmpdudp 0 010.90.56.21 : 123 0.0.0.0 895/ntpdudp * 0127.0.0.1 123 0.0.0.0 * 895/ntpdudp 00 0.0.0.012 0.0.0.015 * 895/ntpdudp 00 0.0.0.0 1396/snmpdudp6 53390 0.0.0.0 1396/snmpdudp6 0:: 123:: * 895/ntpdIPv6/IPv4 Group MembershipsInterface RefCnt Group- lo 1 224.0.0.1eth0 1 224.0.0.1lo 1 ff02::1lo 1 ff01::1eth0 1 ff02::1eth0 1 ff01::1
You can also use the following command to check specific ports.
# # netstat-tplugn | grep: 22tcp 0 0 0.0 0 grep 22 0.0.0 22tcp * LISTEN 1388/sshdtcp6 0 0:: 22: * how does LISTEN 1388/sshd use the Linux command ss to check the list of open ports in the system?
Ss is used to dump socket statistics. It can also display information similar to netstat. It can display more TCP status information than other tools.
# ss-lntuNetid State Recv-Q Send-Q Local Address:Port Peer Address:Portudp UNCONN 0 0 *: 39136 *: * udp UNCONN 0 0 *: 56130 *: * udp UNCONN 0 0 *: 40105 *: * udp UNCONN 0 0 *: 11584 *: * udp UNCONN 0 0 *: 30105 *: * udp UNCONN 0 0 *: 50656 *: * udp UNCONN 0 *: 1632 *: * udp UNCONN 0 0 *: 28265 *: * udp UNCONN 0 0 *: 40764 *: * udp UNCONN 0 0 10.90.56.21 *: * udp UNCONN 0 0127.0.0.1 123 *: * udp UNCONN 0 0 *: 123 *: * udp UNCONN 0 0 *: 53390 *: * udp UNCONN 0 0 *: 161 *: * udp UNCONN 00: 123: * tcp LISTEN 0 100 *: 25 *: * tcp LISTEN 0 128 127.0.0.1 199 *: * tcp LISTEN 0 128 *: 80 *: * Tcp LISTEN 0 128 *: 22 *: * tcp LISTEN 0 100: 25: * tcp LISTEN 0 128:: 22:: *
You can also use the following command to check specific ports.
# # ss-lntu | grep': 25'tcp LISTEN 0100 *: 25 *: * tcp LISTEN 0100: 25: * how to use the Linux command nmap to check the list of open ports in the system?
Although Nmap is commonly used for security audits, many system and network administrators find it useful for day-to-day tasks such as network inventory, managing service upgrade plans, and monitoring host or service uptime.
Nmap-sTU-O localhostStarting Nmap 6.40 (http://nmap.org) at 2019-03-20 09:57 CDTNmap scan report for localhost (127.0.0.1) Host is up (0.00028s latency) .Other addresses for localhost (not scanned): 127.0.0.1Not shown: 1994 closed portsPORT STATE SERVICE22/tcp open ssh25/tcp open smtp80/tcp open http199/tcp open smux123/udp open ntp161/udp open snmpDevice type: general purposeRunning: Linux 3.XOS CPE: cpe:/o:linux:linux_ Kernel:3OS details: Linux 3.7-3.9Network Distance: 0 hopsOS detection performed. Please report any incorrect results at http://nmap.org/submit/ .nmap done: 1 IP address (1 host up) scanned in 1.93 seconds
You can also use the following command to check specific ports.
Nmap-sTU-O localhost | how does grep 123123/udp open ntp use the Linux command lsof to check the list of open ports in the system?
It shows you a list of open files on the system and the process of opening them. Other information related to the file will also be displayed to you.
# lsof-iCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEntpd 895 ntp 16u IPv4 18481 0t0 UDP *: ntpntpd 895 ntp 17u IPv6 18482 0t0 UDP *: ntpntpd 895 ntp 18u IPv4 18487 0t0 UDP localhost:ntpntpd 895 ntp 20u IPv4 23020 0t0 UDP CentOS7.2daygeek.com:ntpsshd 1388 root 3u IPv4 20065 0t0 TCP *: ssh (LISTEN) sshd 1388 root 4U IPv6 20067 0t0 TCP *: ssh (LISTEN) snmpd 1396 root 6u IPv4 22739 0t0 UDP *: snmpsnmpd 1396 root 7u IPv4 22729 0t0 UDP *: 40105snmpd 1396 root 8u IPv4 22730 0t0 UDP *: 50656snmpd 1396 root 9u IPv4 22731 0t0 UDP *: pammratcsnmpd 1396 root 10u IPv4 22732 0t0 UDP *: 30105snmpd 1396 root 11u IPv4 22733 0t0 UDP *: 40764snmpd 1396 root 12u IPv4 22734 0t0 UDP *: 53390snmpd 1396 root 13U IPv4 22735 0t0 UDP *: 28265snmpd 1396 root 14u IPv4 22736 0t0 UDP *: 11584snmpd 1396 root 15u IPv4 22737 0t0 UDP *: 39136snmpd 1396 root 16u IPv4 22738 0t0 UDP *: 56130snmpd 1396 root 17u IPv4 22740 0t0 TCP localhost:smux (LISTEN) httpd 1398 root 3u IPv4 20337 0t0 TCP *: http (LISTEN) master 2038 root 13u IPv4 21638 0t0 TCP *: smtp (LISTEN) master 2038 root 14u IPv6 21639 0t0 TCP *: smtp (LISTEN) sshd 9052 root 3u IPv4 1419955 0t0 TCP CentOS7.2daygeek.com:ssh- > Ubuntu18-04.2daygeek.com:11408 (ESTABLISHED) httpd 13371 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13372apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13373 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13374 apache 3U IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13375 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN)
You can also use the following command to check specific ports.
# lsof-i:80COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEhttpd 1398 root 3U IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13371 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13372 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13373 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13374 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) httpd 13375 apache 3u IPv4 20337 0t0 TCP *: http (LISTEN) about "how to check the list of local open ports in Linux" ends here Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 261
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.