Save up to 82% on Shared Hosting plans today + A FREE Domain Registration

Knowledge Base FTP & SSH Fix: SSH Authentication Refused: Bad Ownership or Modes for Directory

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

February 23, 2026 2 min read

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.