📖 ~1 min read
Table of contents
Symptom & Impact
ssh login fails with Permission denied (publickey) despite a valid key pair.
Environment & Reproduction
Hit after copying keys with wrong permissions or HOMEDIR on a non-standard filesystem.
Root Cause Analysis
sshd refuses keys when ~/.ssh or authorized_keys are group/world writable.
Quick Triage
Check perms with ls -la ~/.ssh and tail /var/adm/messages or sshd log.
Step-by-Step Diagnosis
Run sshd -ddd -p 2222 in foreground to capture the rejection reason.

Solution – Primary Fix
Fix with chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys && chown $USER:staff.
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
If StrictModes is enforced, also ensure the home dir is not group writable.
Verification & Acceptance Criteria
ssh connects without password and sshd log shows Accepted publickey.
Rollback Plan
Restore previous authorized_keys backup and revert chmod if access broke.
Prevention & Hardening
Distribute keys via Ansible and audit perms with find ~/.ssh -perm /go+w.
Related Errors & Cross-Refs
Related to PAM failures, login.cfg restrictions, and LDAP user lookup issues.
Related tutorial: View the step-by-step tutorial for aix-7.2.
View all aix-7.2 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
IBM AIX 7.2 OpenSSH and PAM administration 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.