Skip to main content

Port 22

Port 22 Secure Shell

SSH listens on port 22 on almost every server and many network devices. Every exposed one receives login attempts within minutes.

The service

What is port 22 used for?

Port 22 is the standard port of SSH (Secure Shell), the encrypted remote login used to run Linux and Unix servers, network devices and many appliances. File transfer over SFTP and SCP runs on it too.

Unlike the other services on these pages, SSH often needs to be reachable from the internet, and with the right settings it can be.

Why attackers want it

A server with password login and a weak password falls to guessing. Once in, attackers install their own key so they keep access, start cryptocurrency miners, and add the server to a botnet that scans for the next one.

The last 31 days

Who scans port 22

Every address that scanned port 22 from 28 October to 27 November 2026, with known scanners left out.

Port 22 Secure Shell
Analyze
Observation window
First day28 Oct
Last day27 Nov
Known scanners left out16,6%
39.637Sources
50.856.359Connections
7.601Known scanners
31/31Active days
Sources per dayPeak 9.671 · 5 Nov
Top source networksSources
  1. AS14061DigitalOcean, LLC 4.841
  2. AS4134Chinanet 1.313
  3. AS8075Microsoft Corporation 1.165
  4. AS14618Amazon.com, Inc. 953
  5. AS135377UCLOUD INFORMATION TECHNOLOGY (HK) LIMITED 830
  6. AS22773Cox Communications Inc. 796
  7. AS45090Shenzhen Tencent Computer Systems Company Limited 730
  8. AS4766Korea Telecom 652
  9. AS45102Alibaba (US) Technology Co., Ltd. 651
  10. AS37963Hangzhou Alibaba Advertising Co.,Ltd. 539
Top source countriesSources
  1. United States of America 10.690
  2. People's Republic of China 5.443
  3. Germany 1.849
  4. India 1.731
  5. Hong Kong 1.604
  6. Brazil 1.348
  7. United Kingdom 1.265
  8. Netherlands 1.192
  9. South Korea 918
  10. Vietnam 820
The verdict

Should port 22 be open?

Port 22 can be open when it has to be, but only with key based login, no password login and no direct root login. Better still, allow it only from the addresses that need it, or reach it through a VPN.

Use keys, not passwords

Turn off password authentication and direct root login, and check authorized_keys for keys you did not add.

Limit who can connect

Allow port 22 only from known addresses or through a VPN, and rate limit new connections.

Keep OpenSSH current

Update OpenSSH and the system it runs on. regreSSHion (CVE-2024-6387) was fixed in OpenSSH 9.8p1.

Questions

Port 22 questions

What is port 22 used for?

Port 22 is the standard port of SSH, the encrypted remote login for servers and network devices. SFTP and SCP file transfers use it too.

Is it safe to have port 22 open?

It can be, with key based login only, password login and root login turned off, and the software kept up to date. Limiting it to known addresses or a VPN is safer still.

Should I move SSH to another port?

A different port cuts the noise in your logs but not the risk. Scanners find SSH on any port. Keys, no password login and blocking known attackers are what protect it.

How do I block attacks on port 22?

Allow SSH only from the addresses that need it, rate limit new connections, and block the addresses that scan for SSH with an IP blocklist before they reach the server.

Port 22

Block the sources that scan port 22.

An hourly IP feed of active scanners keeps them away from this port and everything else you run.