Networking
Risk: Critical
Port 22 β SSH (Secure Shell) & SFTP
Port 22 is the standard port used for Secure Shell (SSH) remote command execution, secure file transfer (SFTP), and Git over SSH (`git@github.com`).
PORT NUMBER
22
PROTOCOL
TCP
DEFAULT PROCESS
sshd
FIREWALL TARGET
22/tcp
Instant Terminal Fixes for Port 22
macOS & Linux Terminal
1. Check who is listening on port 22:
sudo ss -tulpn | grep :222. Kill process occupying port 22 (EADDRINUSE fix):
sudo systemctl restart sshd3. UFW Firewall Allow rule:
sudo ufw allow 22/tcpWindows PowerShell (Admin)
1. Check listening port:
Get-NetTCPConnection -LocalPort 222. Force kill process on port 22:
Stop-Service sshd -Force3. Docker Port Forwarding Mapping:
docker run -p 2222:22 -d my-ssh-serverCommon Error Encountered
ssh: connect to host example.com port 22: Connection refused / Connection timed out
Security Advisory & Hardening
Public port 22 is under constant brute-force dictionary attack. Disable password authentication (`PasswordAuthentication no`), disable root login (`PermitRootLogin no`), and install Fail2ban.
Frequently Asked Questions
Port 22 Questions & Answers
Common questions regarding default services, kill commands, and firewall configurations.
Port 22 is commonly used for SSH (Secure Shell) & SFTP. Port 22 is the standard port used for Secure Shell (SSH) remote command execution, secure file transfer (SFTP), and Git over SSH (`git@github.com`).