Port 22: what it is
Port 22 is where SSH, the Secure Shell, listens by default. It carries remote command lines, file copies with scp and SFTP, and tunnels to other ports, all inside one encrypted connection. IANA registered it for SSH; telnet, which sends everything in clear text, lives on port 23.
In the port lookup it is listed as SSH, SFTP on TCP. This page opens that tool on 22.
- Remote shell: ssh user@host opens a terminal on the server.
- File transfer: scp and sftp use the same port; FTPS, a different thing, uses 21 or 990.
- Tunnels and git: ssh -L forwards a local port to a remote one, and git over SSH (git@github.com) connects here too.
Test it and open it
Is the server listening, and can I reach it?
sudo ss -ltnp | grep ":22" # on the server
nc -vz server.example.com 22 # from your machine
ssh -v user@server.example.com # shows each step of the handshakeOpen the port, or use another one
sudo ufw allow 22/tcp
# /etc/ssh/sshd_config
Port 2222
ssh -p 2222 user@server.example.comErrors you will meet
| Message | What it usually means |
|---|---|
Connection refused | The host answered, but nothing listens on that port: sshd is stopped or on another port. |
Connection timed out | No answer at all: a firewall or security group drops the packets, or the address is wrong. |
Permission denied (publickey) | The server is reachable, but it did not accept your key: wrong user, wrong key, or the file mode of the key is too open (it must be 600). |
Keep it safe
- Use keys, not passwords, and set PasswordAuthentication no in sshd_config once your key works.
- Do not allow root login (PermitRootLogin no) and limit who may connect with AllowUsers.
- Moving SSH to another port does not secure it, it only quiets the log of bots; use a firewall allow-list and fail2ban for the real protection.
Neighbours in the same category
Other remote access ports in the lookup tool:
| Port | Protocol | Service | Source |
|---|---|---|---|
| 22 | TCP | SSH, SFTP | IANA registry |
| 23 | TCP | Telnet | IANA registry |
| 3389 | TCP/UDP | RDP | IANA registry |
| 5900 | TCP | VNC | IANA registry |
| 5985 | TCP | WinRM HTTP | IANA registry |
| 5986 | TCP | WinRM HTTPS | IANA registry |
| 6000 | TCP | X11 | IANA registry |
Look up another port
- Type a port number (443), a range (8000-8100) or a word (database) in the search box.
- Filter by protocol (TCP or UDP) or by category with the buttons above the table.
- Copy a line, or print the table as a one-page reference.
Frequently asked questions
Is port 22 TCP or UDP?
TCP. SSH needs a reliable ordered stream, so there is nothing to open on UDP.
Should I change the SSH port?
It is optional and cosmetic: it cuts the noise of automated scans in the log, but a scanner finds the new port in seconds. Keys and a firewall are what protect you.
Why does SFTP use port 22 and not 21?
SFTP is not FTP over SSL: it is a subsystem of SSH, so it rides on the SSH connection. FTP and FTPS have their own ports.