📖 ~1 min read
Table of contents
Symptom & Impact
Remote SSH sessions are dropped or blocked, risking full administrative lockout.
Environment & Reproduction
Happens when UFW is enabled before allow rules for SSH are applied.
Root Cause Analysis
Firewall default deny policy blocks inbound SSH management port.
Quick Triage
Use console access to inspect active UFW rules and default policies.
Step-by-Step Diagnosis
Confirm listening SSH port and verify matching UFW allow rule.

Solution – Primary Fix
Add explicit allow rule for SSH and reload firewall safely.
Still having issues? Our IT Consulting team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Temporarily disable UFW during emergency recovery then reapply hardened rules.
Verification & Acceptance Criteria
SSH connectivity works from authorized networks while firewall remains enabled.
Rollback Plan
Restore previous firewall policy set if required application ports break.
Prevention & Hardening
Apply staged firewall changes with out-of-band console fallback available.
Related Errors & Cross-Refs
Connection timed out, no route to host, and refused connection after UFW change.
Related tutorial: View the step-by-step tutorial for Ubuntu 20.04 LTS.
View all Ubuntu 20.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
UFW operational safety and Ubuntu server firewall administration docs.
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.