Select a new port
There are a total of 65,536 communication ports which are categorized into three ranges.
Port Category |
Range |
Usage |
---|---|---|
Well known/System Ports | 0 -1023 | These are reserved ports for running system-specific services like SSH which usually runs on 22, HTTPS listens on 443, etc and the process must execute with superuser privileges to be able to bind a network socket to an IP address using one of the well-known ports. |
Registered Ports | 1024 – 49151 | These ports are assigned by IANA for specific services upon application by a requesting entity and they can also be used by ordinary users. |
Dynamic/Private ports | 49152 -65535 | These ports cannot be registered with IANA, it is used for private or customized services or for temporary purposes. |
In this example, we will take port 5444 and have to make sure that the port is open meaning it should not be used by any other application. There are numerous Linux commands available to list the open ports and we will check for open ports using lsof command,
sudo lsof -i -P -n | grep LISTEN
Let’s try port 5432 and see if it’s open or not,
5432 is used by Postgres, so let’s check for another port 5444,
5444 port is not used by any service, so it can be taken as a default port for sshd.
How to change the default SSH port in Linux
SSH (Secure Shell) is a network protocol used to securely connect to the remote server where the data between the server and client is transferred in an encrypted format.
In the world of Linux system administration and security, one essential practice is changing the default SSH port. This article will guide you through the process of enhancing your server’s security by altering the default SSH port, providing you with valuable skills to protect your system from potential threats and unauthorized access. Join us in this informative exploration of “How to Change the Default SSH Port in Linux.”