In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the netcat command in Linux to determine whether a port is open or not, which has a certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article.
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: Connection refused Thank you for reading this article carefully. I hope the article "how to use the netcat command in Linux to determine whether a port is open or not" shared by the editor will be helpful to you. At the same time, I hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!
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: 243
*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.