In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to check whether a port is open in linux. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.
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 command body that executes; z: zero Imax O mode (used for scanning); v: explicit output; w3: set the timeout to 3 seconds; 192.168.1.8: the IP address of the target system; 22: the port that needs to be authenticated.
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 packet 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 22Starting 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 SERVICE22/tcp open sshNmap 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 httpNmap done: 1 IP address (1 host up) scanned in 13.07 seconds how do I 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 is all the contents of the article "how to check whether a port is open in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.