4 Easy Ways To Check HTTPS Port 443 is Open on Linux

Posted on

4 Easy Ways To Check HTTPS Port 443 is Open on Linux

4 Easy Ways To Check HTTPS Port 443 is Open on Linux

This guide aims to teach you how to Check HTTPS Port 443 is open on Linux. Port 443 is the standard port used for HTTPS services, handling all secure transactions. If you need to determine if port 443 is open on your Linux machine, the following methods, inspired by Orcacore, will help.

What is port 443 used for in Linux?

Port 443 is the cornerstone for secure communication on Linux systems, specifically used for HTTPS (Hypertext Transfer Protocol Secure) traffic. Any service requiring an encrypted connection relies on this port. Now, let’s explore different techniques to Check HTTPS Port 443 is Open on Linux.

To Check HTTPS Port 443 is Open on Linux, you’ll need either root access or a user account with sudo privileges on your server. With the necessary permissions, you can use various Linux Commands to assess the status of port 443.

Check HTTPS Port 443 is Open on Linux
Check HTTPS Port 443 is Open on Linux

Number 1 – Find Port 443 is Open with netstat Command

One method to check your HTTPS traffic involves using the netstat command. This command provides insights into network connections, routing tables, and various network interface statistics.

netstat is part of the net-tools package, which might not be installed by default on your Linux system. Therefore, you might need to install it before using it.

To install net-tools on Debian / Ubuntu, use the following command:

sudo apt install net-tools -y

For installing net-tools on Centos / RHEL, use these commands:

# sudo yum install epel-release
# sudo yum install net-tools

Now, you can identify which services are listening on port 443 by executing the following netstat command:

sudo netstat -tulpn | grep LISTEN | grep :443

Number 2 – Find Port 443 is Open with the ss command

Another Linux command you can use to Check HTTPS Port 443 is Open on Linux is the ss command. The ss command often offers more detailed information about open ports compared to other tools.

The ss command is generally pre-installed on most Linux distributions, making it readily available. Use the following command to check port 443:

sudo ss -tulpn | grep LISTEN | grep :443

This command displays the process name and PID for each listening port.

Number 3 – Check if Port 443 is Open with lsof command

The lsof command is another useful tool for displaying open port 443. "lsof" stands for "list open files," and you can use it to determine whether port 443 is open on your Linux server. Similar to the ss command, it’s usually pre-installed on most Linux servers.

To check port 443 with the lsof command, run the following:

sudo lsof -i -P -n | grep LISTEN | grep :443

The output will show the following information:

  • COMMAND: The name of the process using the port.
  • PID: The process ID.
  • USER: The user owning the process.
  • FD: File descriptor.
  • TYPE: Socket type.
  • DEVICE: Device number.
  • SIZE/OFF: File size or offset.
  • NODE: Node number.
  • NAME: Network address of the socket.

Number 4 – Check if Port 443 is open on a remote machine

If you need to Check HTTPS Port 443 is Open on Linux on a remote machine, you can use the nmap tool. Nmap is used to scan IP addresses and ports on a network and to detect installed applications.

It’s typically not installed by default, so you might need to install it first.

On Debian / Ubuntu:

sudo apt install nmap -y

On Centos / RHEL:

sudo yum install nmap -y

To check if port 443 is open on a remote machine, use the following nmap command:

nmap -p 443 <mark>remote-machine-ip</mark>

The output will show the following information:

  • The IP address of the remote machine.
  • The port number (443).
  • The state of the port (open, closed, filtered).
  • The service running on the port (https).

Alternative Methods to Check Port 443

While the above methods are effective, here are two alternative approaches to Check HTTPS Port 443 is Open on Linux:

Method 1: Using curl or wget

This method attempts to establish an HTTPS connection to the server. If successful, it implies that port 443 is open and accessible. This approach is particularly useful for quickly verifying connectivity from a client perspective.

Explanation:

  • curl and wget are command-line tools for transferring data with URLs.
  • By specifying https:// and the server’s address, we’re attempting to make an HTTPS request.
  • If the server is listening on port 443 and the connection is allowed by firewalls, the command will succeed (though the actual output might be an error page, which still indicates connectivity).
  • If the connection fails (e.g., due to a timeout or connection refused error), it suggests that port 443 is either blocked or not listening.

Code Example:

curl -v https://your_server_ip_or_domain

or

wget https://your_server_ip_or_domain

In the curl example, the -v flag provides verbose output, which includes connection details that can be helpful for troubleshooting. If the connection is successful, you’ll see details about the SSL handshake. If it fails, you’ll see an error message indicating the cause of the failure.

Method 2: Using telnet or nc (netcat)

This method attempts to establish a TCP connection to port 443 on the server. While it doesn’t verify the HTTPS protocol itself, a successful TCP connection indicates that the port is open and listening. This is a lower-level check compared to curl or wget.

Explanation:

  • telnet and nc (netcat) are utilities used for establishing TCP connections.
  • We specify the server’s address and port 443.
  • If the connection is successful, telnet will typically display a blank screen or a message indicating a successful connection. nc will connect silently.
  • If the connection fails, you’ll receive an error message like "Connection refused."

Code Example:

telnet your_server_ip_or_domain 443

or

nc -zv your_server_ip_or_domain 443

In the nc example, -z tells nc to perform a zero-I/O scan, which means it only checks if the port is listening without sending any data. -v provides verbose output. If the port is open, nc will output something like "Connection to your_server_ip_or_domain port 443 [tcp/https] succeeded!".

These alternative methods offer quick and straightforward ways to assess the status of port 443, complementing the more detailed approaches outlined earlier. Remember to replace your_server_ip_or_domain with the actual IP address or domain name of the server you’re testing.

Conclusion

You have now learned to Check HTTPS Port 443 is Open on Linux using various Linux commands such as netstat, ss, lsof, nmap, curl, wget, telnet and nc. These are valuable tools for checking open ports on your Linux server. These tools can help you easily Check HTTPS Port 443 is Open on Linux

We hope this guide has been helpful. You might also find these articles interesting:

Check Your IP Address in Linux

Check Whether Port 25 is Open or Not on Linux

Leave a Reply

Your email address will not be published. Required fields are marked *