📖 ~1 min read
Table of contents
Symptom & Impact
SSH attempts return Permission denied or immediate disconnect.
Environment & Reproduction
Incorrect sshd_config directives, locked account, or wrong key permissions.
Root Cause Analysis
From console, run sshd -t and pw usershow to validate config and account state.
Quick Triage
Re-enable a safe auth path, then restart with service sshd restart.
Step-by-Step Diagnosis
Test daemon syntax using /usr/sbin/sshd -T | head for effective settings.

Solution – Primary Fix
Inspect /etc/ssh/sshd_config and /var/log/auth.log for explicit auth rejection reasons.
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
Set valid AllowUsers, PermitRootLogin policy, correct ~/.ssh permissions, and reload sshd.
Verification & Acceptance Criteria
Confirm key-based login works from a trusted host and shell access is stable.
Rollback Plan
Keep an out-of-band console path and test sshd -t before applying changes.
Prevention & Hardening
Restore previous sshd_config from backup and restart service.
Related Errors & Cross-Refs
Escalate if PAM modules or centralized identity providers are rejecting valid users.
Related tutorial: View the step-by-step tutorial for freebsd-15.
View all freebsd-15 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
sshd -t; service sshd restart; pw usershow ; tail -f /var/log/auth.log
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.