SSH Basics
SSH Port 22 Explained
How the default SSH port works and what to know about firewalls and scanners.
Short answer
How the default SSH port works and what to know about firewalls and scanners. Learn the concept first, then apply it with safe defaults, clear configuration, and repeatable team practices.
What you will learn
- Default port behavior
- Firewall rules
- Changing ports safely
Why this matters
SSH Port 22 Explained is where many server-access decisions start. If a team does not understand the basics, later choices around keys, tunnels, bastions, and hardening become cargo-cult settings instead of deliberate security architecture.
How it works
An SSH session begins when a client connects to an SSH server, usually sshd. The two sides negotiate encryption, the client checks the server host key, and the server decides whether the user can authenticate.
After authentication, SSH can do more than an interactive shell. It can run one command, copy files, forward ports, create SOCKS proxies, and support automation tools. That is why SSH is still central even in cloud-native environments.
The important habit is to separate identity, transport, and authorization. The network path gets you to a host, the host key proves which host answered, and user authentication proves who is asking for access.
Practical example
The exact command or configuration depends on your operating system and security policy, but this pattern is a useful starting point for understanding the workflow.
ssh -p 22 [email protected]
sudo ufw allow 22/tcpAlways test examples in a non-critical session first. SSH server settings can lock you out if authentication, firewall, DNS, or host key state is not understood.
Production checklist
Common mistakes
- Changing server settings before confirming the current client, service, and firewall state.
- Testing only from localhost and forgetting real network paths, DNS, or NAT behavior.
- Skipping documentation, which makes the next teammate rediscover the same setup.
Troubleshooting signals
The server is reachable but SSH fails
Separate network reachability from SSH readiness. Ping or TCP reachability only proves a path exists; it does not prove sshd is listening or allowing your user.
The wrong host answers
Host key warnings often reveal DNS changes, rebuilt machines, reused IPs, or middleboxes. Treat the warning as a security signal until verified.
The command works for one person only
Look for hidden assumptions: local SSH config, a private key on one laptop, agent state, VPN connectivity, or a username baked into shell aliases.
Security notes
- Validate host fingerprints before trusting a new server.
- Prefer key-based access and disable weak authentication where possible.
- Keep a second verified admin path open when changing SSH server settings.
Use SSH Bridge when this becomes a team workflow
SSH Bridge turns SSH basics into a shared workspace: hosts, sessions, files, tunnels, and team access live together, so new users do not need to reconstruct critical access knowledge from scattered notes.
Download SSH Bridge