Tech

Explainer

Updated

What port does SSH use?

Key facts

Port 22 is registered to SSH for TCP, UDP and SCTP, but the SSH standard says a server only normally listens there.

SSH uses port 22. The IANA Service Name and Transport Protocol Port Number Registry assigns port 22 to the service name ssh, described as "The Secure Shell (SSH) Protocol", with RFC 4251 as the reference. The SSH transport standard, RFC 4253, Section 4.1, says that when SSH is used over TCP/IP, "the server normally listens for connections on port 22."

Port 22 by transport protocol

The IANA registry lists three entries for ssh on port 22, one for each transport protocol below.

TransportPortReference listed by IANA
TCP22RFC 4251
UDP22RFC 4251
SCTP22RFC 9260

TCP is the transport the SSH standard describes for port 22: RFC 4253 describes port 22 in its section on use over TCP/IP, and RFC 4251 says the SSH transport layer "will typically be run over a TCP/IP connection, but might also be used on top of any other reliable data stream."

What changed and when

RFC 4253, the Standards Track document for the SSH transport layer, was published in January 2006 and says port 22 "has been registered with the IANA, and has been officially assigned for SSH." The registry page as a whole shows a last update of 2026-11-10.

Can SSH run on a port other than 22?

Yes. RFC 4253 says the server "normally" listens on port 22, and its Section 4 says SSH works over any 8-bit clean, binary-transparent transport and that the client initiates the connection.

The IANA registry also warns that traffic on a registered port does not necessarily correspond to the assigned service, and that firewall and system administrators should configure their systems based on their knowledge of the traffic, not on whether a port number is registered.

Where port 22 sits among port ranges

The IANA registry divides port numbers into three ranges under RFC 6335, which puts port 22 among the System Ports.

RangePortsHow IANA assigns them
System Ports0 to 1023IETF Review or IESG Approval
User Ports1024 to 49151IETF Review, IESG Approval or Expert Review
Dynamic or Private Ports49152 to 65535Not assigned

Other registered ports that involve SSH

Some protocols that run over SSH have registered ports of their own. These entries are from the IANA registry.

PortService nameListed by IANA as
830netconf-sshNETCONF over SSH (RFC 6242)
4334netconf-ch-sshNETCONF Call Home (SSH) (RFC 8071)
5161snmpsshSNMP over SSH Transport Model (RFC 5592)
5162snmpssh-trapSNMP Notification over SSH Transport Model (RFC 5592)

One name in the same search is easy to misread: port 614 is registered as sshell, which the IANA registry describes as SSLshell, a separate service from SSH.

What runs over port 22

RFC 4251 describes SSH as "a protocol for secure remote login and other secure network services over an insecure network." It has three parts: a transport layer protocol for server authentication, confidentiality and integrity; a user authentication protocol; and a connection protocol that multiplexes the encrypted tunnel into logical channels. The same section says the connection protocol provides standard methods for interactive shell sessions and for forwarding arbitrary TCP/IP ports and X11 connections, which travel inside the SSH connection rather than on ports of their own.

Once a TCP connection to port 22 is open, RFC 4253, Section 4.2 requires both sides to send an identification string that starts with SSH-, followed by the protocol version, which is "2.0" for the protocol the standard defines.

Have another question?