π ~1 min read
Table of contents
Symptom & Impact
SSH becomes unreachable immediately after enabling UFW, interrupting remote administration.
Environment & Reproduction
Typical on fresh Ubuntu 22.04 LTS server hardening where no SSH allow rule exists.
Root Cause Analysis
Default UFW inbound policy denies connections unless explicit allow rules are defined.
Quick Triage
Check firewall status from console and confirm whether ssh or custom port rule exists.
Step-by-Step Diagnosis
Inspect active ruleset, port bindings, and sshd ListenAddress configuration.

Solution – Primary Fix
Allow SSH port before enabling or reloading UFW policy.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Allow specific source CIDRs for tighter controls instead of global SSH access.
Verification & Acceptance Criteria
Remote SSH works from authorized hosts while unauthorized inbound traffic remains blocked.
Rollback Plan
Disable UFW from console if emergency access is required, then rebuild rules safely.
Prevention & Hardening
Apply OpenSSH allow rule and test connectivity before firewall activation on production systems.
Related Errors & Cross-Refs
Correlates with custom SSH port migrations and fail2ban jail misconfigurations.
Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.
View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
See man ufw and Ubuntu server security hardening documentation.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.