• Services
    • Web Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Hosting
  • Domains
  • Features
  • Company
    • About Us
    • Server Locations
    • Affiliates
    • Company Blog
  • Support
  • Client Login
  • Services
    • Web Hosting
    • Reseller Hosting
    • VPS Hosting
    • Dedicated Hosting
  • Domains
  • Features
  • Company
    • About Us
    • Server Locations
    • Affiliates
    • Company Blog
  • Support
  • Client Login
Home/Article/Web Hosting/FTP & SSH Access/SSH Authentication Refused: Bad Ownership or Modes for Directory

SSH Authentication Refused: Bad Ownership or Modes for Directory

Written by VernalWeb
August 15, 2022

If you get this error (SSH Authentication Refused) in your logs when trying to set up public key authenticated automatic logins, or while trying to SSH into your account, after setting up the public key the issue is related to permissions.

Tailing /var/log/secure on the target machine will be useful:

tail -f /var/log/secure
Dec 26 12:30:38 server sshd[3503454]: Authentication refused: bad ownership or modes for directory /home/user/.ssh

As you can see – bad ownership or modes for directory /home/user/.ssh.

SSH doesn’t like it if your home or ~/.ssh directories have group write permissions. Your home directory should be writable only by you, ~/.ssh should be 700, and authorized_keys should be 600 :

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

So fixing permissions is the way to go and have this error resolved.

Getting tired of troubleshooting? VernalWeb offers fully managed hosting service designed to save you time and money!  Check out our web hosting plans!

Tags:SSH AccessSSH Authentication Refused

Was this helpful?

Yes  No
Related Articles
  • How to create additional FTP accounts in cPanel
  • How to Change FTP Account Password in cPanel
  • How to Delete an FTP User account from cPanel?
  • Recommended settings for FTP access
  • How to use FTPS in FileZilla for secure FTP access
  • What is an FTP Client?

Didn't find your answer? Submit Ticket

Latest Articles

  • How to show Hidden Files (.htaccess) in cPanel File Manager
  • Setup a Domain Redirection in cPanel
  • Create a MySQL Database and a User from cPanel
  • Remove page extensions using .htaccess
  • Cron Job Usage & Policy
  • © 2014 - 2025 VernalWeb. All rights reserved.