Marcio Cunha

Why Port 22 is the Default Choice for SSH Remote Connections

Discover the historical background and technical reasons that made port 22 the universal standard address for secure remote system administration via Secure Shell.

Marcio Cunha12 min
Also available in:EspañolPortuguês
Summary
  • Port 22 was officially registered with IANA in 1995 to centralize traffic for the Secure Shell protocol.
  • Standardizing network ports eliminates the need to guess addresses across large fleets of remote servers.
  • Using well-known ports simplifies firewall rules and reduces operational overhead for infrastructure teams.
  • Modern servers frequently change the default SSH port to mitigate automated scanning from malicious bots.
  • True remote access security depends on strong cryptographic keys and multifactor authentication rather than port obscurity.

The Origin of Computer Ports and the Rise of SSH

When we think of computer networks, we imagine cables, routers, and data packets traveling across the world in fractions of second. However, for a computer to know exactly what to do with incoming information, it requires specific addresses called ports. Think of network ports like extensions in a large office building: the IP address is the building, and the port is the extension that directs the call to the right department. In computing, each port is represented by an integer between 0 and 65535, organizing who is talking to whom.

In the early days of the internet, remote server administration relied on textual protocols like Telnet. The major flaw of Telnet was its complete lack of security: all data, including usernames and passwords, traveled across the network in plaintext, allowing anyone intercepting the traffic to read credentials. To solve this critical vulnerability, Tatu Ylönen created Secure Shell (SSH) in 1995 in Finland. SSH introduced end-to-end encryption to network communication, transforming remote access into an operation shielded against prying eyes.

The IANA Port 22 Assignment Process

As the SSH protocol grew, defining an official port number became mandatory so clients and servers could connect without complex manual configurations. The global authority responsible for managing these numbers is IANA (Internet Assigned Numbers Authority), the organization that coordinates internet technical parameters. In 1995, IANA officially reserved port 22 for both TCP and UDP protocols, although the vast majority of SSH traffic utilizes TCP due to its delivery guarantee.

The choice of the number 22 did not follow any mystical formula or complex engineering calculation. At the time, requesting a port involved coordinating with IANA to secure an unallocated number not yet associated with another widely used service. Port 21 already belonged to FTP (File Transfer Protocol), and port 23 was occupied by Telnet. Since port 22 was vacant, it fit perfectly into the logical sequence of control and remote access protocols managed within that numeric range.

Why Standardization is Vital for Infrastructure

The existence of a universal standard like port 22 brings massive operational advantages to system administrators and network engineers. Imagine managing a fleet of hundreds of servers scattered worldwide across different cloud providers. If every machine used a random port for remote access, the team would need to maintain complex mapping tables and exhaustive documentation just to open a maintenance terminal.

Furthermore, corporate firewalls and edge routers must know which types of traffic to authorize or block. When an engineer configures security rules to permit server administration, allowing traffic destined exclusively for port 22 is a straightforward, documented procedure understood by any network security tool. This operational predictability accelerates the deployment of new environments and drastically reduces troubleshooting time during critical incidents.

The Operational Reality: Bot Scanning and Security Through Obscurity

Although port 22 is the official standard, keeping it open on its original number exposes the server to a constant phenomenon on the modern internet: automated bot scanning. Malicious robots operated by cybercriminals continuously sweep entire blocks of public IP addresses testing port 22, hoping to find weak passwords or outdated software vulnerabilities. This relentless bombardment generates massive server logs and consumes unnecessary processing cycles.

To mitigate this noise, a common engineering practice involves changing the default SSH port to a less predictable number, such as 2222 or 5022. This technique, known in the security community as security through obscurity, does not replace robust cryptography, but it eliminates most indiscriminate automated scanning traffic. However, any determined attacker can discover the new port in seconds using port mapping tools like Nmap.

Defense Architecture: Cryptographic Keys and Best Practices

Changing the port number 22 is merely a cosmetic log-relief measure; true remote access security lies in how authentication is configured. Traditional passwords pave the way for brute-force attacks, where automated programs repeatedly guess character combinations. The recommended engineering alternative is adopting asymmetric cryptographic keys, consisting of a private key kept secret on the user's computer and a public key installed on the server.

To implement secure SSH access using keys, the basic procedure in a Linux terminal typically follows this practical pattern:

ssh-keygen -t ed25519 -C '[email protected]'

This command generates a key pair using the modern Ed25519 algorithm, offering high security with excellent mathematical performance. Next, the public key can be copied to the remote server using the standard utility:

ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote_server

With this configuration active, the administrator can completely disable password login in the server configuration file (`/etc/ssh/sshd_config`) by changing the `PasswordAuthentication` directive to `no`. This simple decision almost entirely eliminates the risk of breaches due to compromised credentials.

Final Thoughts on the Future of Remote Access

Port 22 remains one of the most critical pillars of modern internet architecture, representing the reliable bridge between human operators and distributed digital infrastructure. Understanding the reason for its existence goes far beyond memorizing a number: it means grasping how standardization and intentional design shaped global network stability over the past decades.

In summary, while modern cloud computing trends and browser-based web dashboards attempt to abstract the terminal, good old SSH access on port 22 remains irreplaceable for deep systems engineering. Mastering its operation and security premises ensures administrators retain absolute control over their environments, regardless of where they physically run.