Back to FTP & SSH
AblePage support

Fix: SSH Authentication Refused: Bad Ownership or Modes for Directory

In this article, we're going to show you how you can fix the error: SSH Authentication Refused: Bad Ownership or Modes for Directory

FTP & SSH Beginner Applies to all hosting plans

If you are configuring SSH key based authentication, whether for automated access or direct logins, you may encounter the following error:

SSH Authentication Refused: Bad Ownership or Modes for Directory

This message typically indicates that file or directory permissions are not correctly set. To verify this, you can examine the system log on the destination server. For example:

tail -f /var/log/secure

You may see output similar to the following:

May 21 12:00:00 server sshd[3587469]: Authentication refused: bad ownership or modes for directory /home/user/.ssh

This clearly points to a permissions-related issue with the .ssh directory.

How to SSH Authentication Refused

SSH enforces strict permission settings on the user’s home and .ssh directories. If these directories or the authorized_keys file are writable by group or others, SSH will reject the login attempt for security reasons.

To correct this, ensure that:

  1. Your home directory is not group-writable

  2. The .ssh directory has permissions set to 700

  3. The authorized_keys file is set to 600

You can apply the appropriate permissions with the following commands:

chmod g-w /home/user
chmod 700 /home/user/.ssh
chmod 600 /home/user/.ssh/authorized_keys

After applying these changes, retry your SSH login. The issue should be resolved if all permissions are set correctly.

If you continue to experience problems, please contact our support team for further assistance.

Found this article helpful?

Then you'll love our support. Join AblePage from $2.49/mo, with a free website migration and engineers on hand 24/7 whenever you need them.

Share this article
Table of contents

    Need help?

    Our support team is here 24 hours a day. Tell us what you're trying to do and we'll check your account for you.

    Contact support