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 > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to check whether a port is open in a remote Linux system. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
This can be achieved using the following Linux command:
Nc:netcat is a simple Unix tool that uses TCP or UDP protocols to read and write data between network connections.
Nmap: ("Network Mapper") is an open source tool for network exploration and security audit, designed to scan large-scale networks quickly.
Telnet: used to communicate interactively with another host over the TELNET protocol.
How do I use the nc (netcat) command to see if a port is open on a remote Linux system?
Nc is netcat. Netcat is a simple Unix tool that uses TCP or UDP protocols to read and write data between network connections.
It is designed as a reliable back-end tool that can be used directly or simply called by other programs or scripts.
At the same time, it is also a feature-rich network debugging and exploration tool, because it can create almost all types of connections you need, and it also has several built-in interesting features.
Netcat has three kinds of functional modes, which are connection mode, monitoring mode and tunnel mode.
The general syntax of the nc (netcat) command:
$nc [- options] [HostName or IP] [PortNumber]
In the following example, we will check whether port 22 is open on a remote Linux system.
If the port is open, you will get output similar to the following.
# nc-zvw3 192.168.1.8 22Connection to 192.168.1.8 22 port [tcp/ssh] succeeded!
Detailed description of the command:
Nc: that is, the body of the executed command
Z: zero Imax O mode (used for scanning)
V: output explicitly
W3: set the timeout to 3 seconds
192.168.1.8: IP address of the target system
22: the port that needs to be verified.
When you detect that the port is not open, you will get the following output:
# nc-zvw3 192.168.1.95 22nc: connect to 192.168.1.95 port 22 (tcp) failed: how does Connection refused use the nmap command to see if a port is open on a remote Linux system?
Nmap ("Network Mapper") is an open source tool for network exploration and security auditing, designed to scan large-scale networks quickly, although it also works for a single host.
In a novel way, nmap uses naked IP packets to determine whether hosts on the network are reachable, what services they are providing (application name and version number), the operating system they are running (version of the system), what filtering software or firewalls they are using, and other additional features.
Although nmap is often used for security audits, many system and network administrators find it equally useful in routine tasks such as listing network assets, managing service upgrade plans, and monitoring hosts or services for proper operation.
General syntax for nmap:
$nmap [- options] [HostName or IP] [- p] [PortNumber]
If the port is open, you will get the following output:
# nmap 192.168.1.8-p 22 Starting Nmap 7.70 (https://nmap.org) at 2019-03-16 03:37 IST Nmap scan report for 192.168.1.8 Host is up (0.00031s latency). PORT STATE SERVICE 22/tcp open ssh Nmap done: 1 IP address (1 host up) scanned in 13.06 seconds
If the port is not open, you will get results similar to the following:
# nmap 192.168.1.8-p 80Starting Nmap 7.70 (https://nmap.org) at 2019-03-16 04:30 ISTNmap scan report for 192.168.1.8Host is up (0.00036s latency). PORT STATE SERVICE80/tcp closed http Nmap done: 1 IP address (1 host up) scanned in 13.07 how does seconds use the telnet command to see if a port is open on a remote Linux system?
The telnet command is used to communicate interactively with another host over the TELNET protocol.
The general syntax of the telnet command:
$telnet [HostName or IP] [PortNumber]
If the probe is successful, you will see output similar to the following:
$telnet 192.168.1.9 22Trying 192.168.1.9...Connected to 192.168.1.9.Escape character is'^] '.SSH-2.0 muri OpenSSH _ 5.3 ^] Connection closed by foreign host.
If the probe fails, you will see output similar to the following:
$telnet 192.168.1.9 80Trying 192.168.1.9...telnet: Unable to connect to remote host: Connection refused
Thank you for reading! About "what are the ways to check whether a port is open in a remote Linux system?" this article ends here. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
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: 0
*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.