ssh

What Is Port 22? SSH Port Explained + Common Network Ports

If you have ever managed a server, configured a firewall, connected to a VPS, or looked at a network scan, you have probably encountered port 22. But what exactly is port 22, what is it used for, and why is it associated with SSH?

Port 22 is the default port used by SSH (Secure Shell), a protocol that allows users and administrators to securely connect to remote computers over a network. SSH is commonly used for remote server administration, command-line access, secure file transfers, tunneling, and other network services.

Port 22 is not the only important network port. Other commonly encountered ports include 21 for FTP, 53 for DNS, 80 for HTTP, 443 for HTTPS, 25 for SMTP, and 3389 for Remote Desktop Protocol (RDP). Proxmox VE commonly uses port 8006 for its web management interface.

This guide explains what port 22 means, what SSH does, whether SSH uses TCP or UDP, how ports work, and what the most common network ports are used for.

Quick Answer: What Is Port 22?

Port 22 is the standard port associated with SSH, or Secure Shell. SSH provides encrypted remote access to computers and servers.

For example, when you run:

ssh [email protected]

the SSH client normally attempts to connect to the remote server using port 22, unless the server administrator has configured SSH to use another port.

The Internet Assigned Numbers Authority (IANA) lists SSH on port 22. The SSH protocol itself is formally documented in the Internet Engineering Task Force’s RFC 4251. IANA’s Service Name and Port Number Registry and RFC 4251 are useful primary references.

What Is SSH?

SSH stands for Secure Shell. It is a network protocol designed to provide secure remote login and other secure network services over an otherwise insecure network.

SSH is especially common on Linux and Unix servers, cloud servers, virtual private servers (VPSs), network appliances, development environments, and infrastructure systems.

With SSH, an administrator can remotely:

  • Log in to a server.
  • Run commands.
  • Manage files and directories.
  • Install and configure software.
  • Restart services.
  • Transfer files securely.
  • Create encrypted tunnels.
  • Forward network connections.

Unlike older remote-access protocols such as Telnet, SSH is designed to protect the confidentiality and integrity of the connection. The SSH architecture includes transport, authentication, and connection components that work together to establish a secure session. RFC 4251 describes the architecture in detail.

What Port Does SSH Use?

SSH uses port 22 by default. This is the answer to questions such as “what port is SSH?”, “what port does SSH use?”, and “what is the SSH port?”

Port 22 is the default, not a requirement. An administrator can configure an SSH server to listen on another port.

For example, an SSH server could be configured to listen on port 2222. A client would then connect using:

ssh -p 2222 [email protected]

This is why simply knowing that port 22 is the SSH port does not guarantee that a particular server actually runs SSH there. The service configuration and network environment determine which port is listening.

Does SSH Use TCP or UDP?

SSH normally uses TCP. TCP provides the reliable, ordered data stream that SSH typically runs over.

For most everyday server administration, the important combination to remember is:

  • Protocol: SSH
  • Default port: 22
  • Transport: TCP

IANA’s registry associates SSH with port 22, while the SSH architecture specification explains that the transport protocol will typically run over a TCP/IP connection. IANA Port Registry and RFC 4251 provide the technical references.

What Is Port 22 Used For?

Port 22 is primarily used as the default network endpoint for SSH connections.

Common uses include:

  • Remote server administration: Administrators can log in to Linux and other SSH-enabled systems.
  • Remote command execution: Commands can be executed on another computer through an SSH session.
  • SFTP: Secure File Transfer Protocol operates through SSH connections.
  • SCP: Secure Copy uses SSH for secure file transfers.
  • SSH tunneling: SSH can forward network traffic through an encrypted connection.
  • Infrastructure management: DevOps and system administrators frequently use SSH to manage servers and services.

Cloudflare also identifies remote server management, secure file transfer, and private-network access among common SSH use cases. Cloudflare’s SSH overview provides additional background.

What Is on Port 22?

If a server is listening on TCP port 22, it often means that an SSH server is running there. On a Linux server, the SSH service is commonly provided by an SSH daemon such as sshd.

However, a port number alone does not prove which application is running. Administrators can configure services to use different ports, and different applications can be configured in different ways.

For example, SSH could be configured to use port 2222 instead of port 22. Conversely, another application could theoretically be configured to listen on port 22.

Why Is SSH on Port 22?

Port 22 became associated with SSH as part of the protocol’s historical registration with the Internet Assigned Numbers Authority. The number itself does not provide encryption or security. It is simply the conventional port assigned to the SSH service.

APNIC has also published a detailed historical explanation of how SSH came to use port 22. Read APNIC’s history of SSH and port 22.

Is Port 22 Secure?

Port 22 itself is neither secure nor insecure. A port is simply a numbered communication endpoint. The security of an SSH service depends on how SSH and the surrounding server are configured.

SSH is designed to provide encryption, authentication, and integrity protection. However, a poorly configured SSH server can still create security problems.

For example, administrators should consider:

  • Using strong authentication.
  • Preferably using SSH keys or another strong authentication mechanism where appropriate.
  • Disabling unnecessary authentication methods.
  • Restricting SSH access with firewall rules where practical.
  • Keeping the SSH implementation and operating system updated.
  • Limiting access to administrative accounts.
  • Monitoring authentication logs.
  • Using additional access controls such as VPNs or network allowlists when appropriate.

Changing port 22 to another number can reduce exposure to some automated scans, but changing the port is not a substitute for proper SSH security. The actual security controls are authentication, encryption, patching, access restrictions, and server configuration.

What Is the Difference Between Port 22 and SSH?

This distinction is simple but important:

SSH is the protocol. Port 22 is the default port number associated with that protocol.

Think of an IP address as the address of a building and a port as a particular doorway or service entrance. The IP address identifies the host, while the port helps the operating system determine which network service should receive the traffic.

Therefore:

  • SSH = secure remote-access protocol.
  • Port 22 = default network port for SSH.
  • TCP = transport protocol normally used by SSH.

What Are Network Ports?

A network port is a logical communication endpoint identified by a number. TCP and UDP use port numbers to help deliver network traffic to the appropriate service on a device.

Port numbers range from 0 through 65535. IANA divides ports into several broad categories, including well-known ports, registered ports, and dynamic/private ports.

Some port numbers have become strongly associated with widely used services. Examples include port 22 for SSH, port 53 for DNS, port 80 for HTTP, and port 443 for HTTPS.

It is important to remember that these associations are conventions and registrations. A network administrator can configure many services to use different ports.

Common Network Ports and What They Do

PortServiceProtocolCommon Purpose
20FTP DataTCPTraditional FTP data transfer
21FTPTCPFTP control connection
22SSHTCPSecure remote administration and related SSH services
23TelnetTCPLegacy remote terminal access
25SMTPTCPEmail transfer
53DNSTCP/UDPDomain name resolution
80HTTPTCPTraditional unencrypted web traffic
110POP3TCPEmail retrieval
143IMAPTCPEmail access and synchronization
443HTTPSTCPTLS-encrypted web traffic
3389RDPTCP/UDPRemote Desktop access
8006Proxmox VEHTTPS/TCPProxmox web management interface

IANA’s official service-name and port-number registry is the best place to verify standardized port assignments. View the IANA Service Name and Port Number Registry.

What Is Port 21 Used For?

Port 21 is traditionally used by FTP, or File Transfer Protocol. IANA registers port 21 for FTP’s control connection, while traditional FTP uses a separate data connection as part of its operation.

FTP was designed for transferring files between computers. Unlike SSH-based file transfer, traditional FTP does not provide the same built-in encrypted protection for credentials and data.

For systems that require secure file transfers, administrators commonly consider alternatives such as SFTP or appropriately configured FTPS rather than ordinary FTP.

One common source of confusion is that SFTP is not FTP running on port 21. SFTP is an SSH-based file transfer subsystem and normally uses the SSH connection, commonly port 22.

What Is Port 53 Used For?

Port 53 is associated with DNS, the Domain Name System.

DNS translates human-readable domain names into information that computers can use, such as IP addresses.

For example, when a device needs to find the IP address associated with a domain name, it can send a DNS query to a DNS resolver.

DNS commonly uses UDP port 53 for ordinary queries, while TCP port 53 is also used for situations such as larger responses and DNS zone transfers. The exact behavior depends on the DNS operation and implementation.

What Is Port 80 Used For?

Port 80 is traditionally associated with HTTP, or Hypertext Transfer Protocol.

HTTP is used for communication between web browsers and web servers. When a website is accessed using ordinary HTTP, port 80 is the conventional default.

Modern websites generally use HTTPS instead, which provides encryption through TLS.

What Is Port 443 Used For?

Port 443 is the standard port associated with HTTPS.

HTTPS is HTTP carried over a TLS-secured connection. It is the protocol normally used when you visit a website beginning with https://.

For example:

https://example.com

Browsers normally use TCP port 443 for HTTPS, although modern web technologies can also use HTTP/3 over QUIC, which operates over UDP.

What Is Port 8006 Used For?

Port 8006 is commonly used by Proxmox Virtual Environment (Proxmox VE) for its web-based management interface.

If you have installed Proxmox VE, you will commonly access its management interface using an HTTPS address similar to:

https://SERVER-IP:8006

The official Proxmox VE Administration Guide instructs users to access the web interface using the installation IP address and port 8006. Proxmox VE Administration Guide.

Port 8006 is therefore particularly relevant to people managing virtualization servers, home labs, dedicated servers, and Proxmox-based infrastructure.

Why Does Proxmox Use Port 8006?

Proxmox VE uses a dedicated web management port so its administration interface can be accessed separately from ordinary web services running on ports such as 80 and 443.

For example, a server could potentially have:

  • Port 22 for SSH administration.
  • Port 80 for an HTTP website.
  • Port 443 for an HTTPS website.
  • Port 8006 for the Proxmox VE management interface.

This separation allows different applications and services to coexist on the same server without competing for the same network endpoint.

How Do I Access Proxmox on Port 8006?

If your Proxmox server’s IP address is 192.168.1.100, you would normally enter:

https://192.168.1.100:8006

The important details are HTTPS and :8006.

If the page does not load, possible causes include a firewall rule, incorrect IP address, network routing, a service problem, or another configuration issue. The Proxmox documentation should be consulted alongside the server’s local configuration when troubleshooting.

Can SSH and Proxmox Use the Same Server?

Yes. A Proxmox host can provide both SSH access and its web management interface.

A common setup might look like this:

SSH → TCP 22 Proxmox → TCP 8006

These are separate services using separate ports. Connecting to port 22 does not automatically connect you to the Proxmox web interface, and connecting to port 8006 does not provide an SSH shell.

How Can I Check Whether Port 22 Is Open?

There are several ways to check whether a port is reachable, depending on whether you are testing from the same machine or another device.

On a Linux server, the ss command can show listening sockets. For example:

sudo ss -tlnp | grep :22

You can also check the SSH service configuration. On many Linux distributions, SSH configuration is found in or around:

/etc/ssh/sshd_config

DigitalOcean’s SSH troubleshooting documentation also recommends checking the SSH configuration and using ss to determine which port the SSH service is listening on. DigitalOcean’s SSH connectivity troubleshooting guide.

Why Can’t I Connect to Port 22?

If an SSH connection fails, the problem does not necessarily mean that SSH is broken.

Common causes include:

  • The SSH service is not running.
  • SSH is configured to use another port.
  • A local firewall is blocking port 22.
  • A cloud provider firewall or security group is blocking access.
  • The server is behind NAT without appropriate port forwarding.
  • The server IP address or hostname is incorrect.
  • The SSH server is reachable only from a private network.
  • Authentication is failing even though the port is reachable.

A useful troubleshooting approach is to separate network connectivity from authentication. A timeout can indicate that traffic is being filtered or that the destination is unreachable, while an authentication error means you have reached the SSH service but cannot successfully authenticate.

Does Changing the SSH Port Improve Security?

SSH can be configured to listen on a non-default port, such as 2222. Some administrators do this to reduce noise from automated scans aimed at the default SSH port.

However, changing the port number should not be treated as a primary security mechanism. A determined scanner can scan other ports, so moving SSH from 22 to another number does not replace authentication controls, firewall restrictions, patching, and monitoring.

If you change the SSH port, make sure the firewall allows the new port before closing access to the old one. Test the new connection from a separate session so that you do not accidentally lock yourself out.

Do SFTP and SCP Use Port 22?

Yes, normally. SFTP and SCP use SSH infrastructure and therefore commonly use port 22 when SSH is running on its default port.

For example, an SFTP connection might look like:

sftp [email protected]

And an SCP transfer could look like:

scp file.txt [email protected]:/home/username/

If SSH is configured to use a different port, the SFTP or SCP client can be configured to connect to that port as well.

Is Port 22 the Same as SFTP?

No. Port 22 and SFTP are not the same thing.

Port 22 is a port number. SFTP is a file-transfer protocol that operates through SSH.

A useful way to remember the relationship is:

SSH → protocol 22 → default SSH port SFTP → secure file transfer over SSH

What Is the Difference Between SSH and FTP?

SSH and FTP are different protocols with different purposes and security characteristics.

FeatureSSHFTP
Typical default port2221
Main purposeSecure remote access and related servicesFile transfer
EncryptionDesigned for encrypted communicationTraditional FTP does not encrypt the session by default
Remote shellYesNo
Secure file transfer optionSFTP/SCPFTPS is a separate TLS-secured approach

For modern server administration, SSH is widely used because it combines secure remote access with other capabilities such as tunneling and secure file transfer.

What Are the Most Important Ports to Know?

If you are learning networking, you do not need to memorize hundreds of port numbers immediately. Start with the ports you are most likely to encounter.

  • 20: FTP data
  • 21: FTP control
  • 22: SSH
  • 23: Telnet
  • 25: SMTP
  • 53: DNS
  • 80: HTTP
  • 110: POP3
  • 143: IMAP
  • 443: HTTPS
  • 3389: RDP
  • 8006: Proxmox VE web interface

The official IANA registry is the appropriate reference when you need to verify a registered service and its port assignment rather than relying solely on a memorized list.

Frequently Asked Questions About Port 22

What is port 22?

Port 22 is the default port associated with the Secure Shell (SSH) protocol. SSH is used for secure remote access, server administration, command execution, secure file transfer, and tunneling.

What port is SSH?

SSH uses port 22 by default. An administrator can configure SSH to use a different port.

What port does SSH use?

SSH normally uses TCP port 22. The actual port can be changed in the SSH server configuration.

What port does SSH use on Linux?

On many Linux systems, SSH listens on TCP port 22 by default. However, administrators can configure another port, so checking the server’s SSH configuration is the best way to confirm.

Does SSH use TCP or UDP?

SSH typically uses TCP. For ordinary SSH server administration, TCP port 22 is the standard combination.

What is port 22 used for?

Port 22 is commonly used for SSH remote login and administration. SSH-based services such as SFTP and SCP also commonly use the same SSH connection.

What is on port 22?

When a server is using its default SSH configuration, an SSH daemon is typically listening on port 22. However, port numbers can be reassigned, so the number alone does not identify the application with absolute certainty.

Is port 22 TCP or UDP?

For normal SSH connections, port 22 is used with TCP. IANA’s registry also contains entries for SSH with other transport registrations, but conventional SSH server administration uses TCP.

Can I change port 22?

Yes. SSH can be configured to listen on another port. If you do this, update your firewall rules and SSH clients accordingly, and test the new connection before closing your existing access.

Is port 22 dangerous?

A port number is not inherently dangerous. However, an internet-accessible SSH service can attract automated connection attempts, so it should be properly secured with strong authentication, updates, access restrictions, and monitoring.

Should port 22 be open?

It should be open only when SSH access is actually required. If SSH is unnecessary, blocking external access to it reduces the number of publicly reachable services. If SSH is required, restrict access as much as practical rather than exposing it unnecessarily.

What port does SFTP use?

SFTP commonly uses port 22 because it operates over SSH. If the SSH service is configured to use another port, SFTP can use that port as well.

What port does FTP use?

Traditional FTP uses port 21 for its control connection. FTP also uses a separate data connection, whose port behavior depends on whether active or passive FTP is being used.

What port does DNS use?

DNS uses port 53. DNS queries commonly use UDP, while TCP is also used for certain DNS operations.

What port does HTTP use?

HTTP traditionally uses port 80.

What port does HTTPS use?

HTTPS traditionally uses port 443. Modern HTTP/3 can use QUIC over UDP, so the underlying transport can differ from traditional HTTPS over TCP.

What port does Proxmox use?

Proxmox VE commonly uses port 8006 for its HTTPS web management interface. The official Proxmox VE Administration Guide documents accessing the interface through port 8006.

Port 22 vs Port 21 vs Port 53 vs Port 443

These four ports are frequently encountered in server and network administration, but they perform very different roles:

PortServiceWhat It Does
21FTPFTP control connection and file-transfer operations
22SSHSecure remote access and SSH-based services
53DNSDomain name resolution
443HTTPSEncrypted web communication

Understanding these differences makes firewall configuration and network troubleshooting much easier.

Why Understanding Ports Matters

Ports are one of the fundamental concepts behind network communication. When you connect to a server, the IP address identifies the host while the port helps identify the service you are trying to reach.

For example, these addresses can point to the same server but different services:

server.example.com:22 server.example.com:443 server.example.com:8006

The first may provide SSH, the second HTTPS, and the third a Proxmox management interface.

This is also why firewalls frequently contain rules based on ports. A firewall can allow SSH from a trusted network while allowing HTTPS from the public internet and blocking administrative interfaces such as a virtualization management panel from external access.

Final Thoughts

Port 22 is the default port for SSH, the Secure Shell protocol. It is widely used for secure remote administration, command execution, SFTP, SCP, and SSH tunneling. For normal SSH connections, TCP is the transport protocol you will most commonly encounter.

Once you understand port 22, it becomes easier to understand other common ports. Port 21 is associated with FTP, port 53 with DNS, port 80 with HTTP, port 443 with HTTPS, and port 8006 is commonly used by Proxmox VE for its web management interface.

The most important thing to remember is that a port number does not provide security by itself. Ports are simply communication endpoints. The security of a service depends on its protocol, configuration, authentication, encryption, firewall policy, software updates, and the environment in which it operates.

Sources and Further Reading

Filed under: ssh