SSH Authentication Refused Bad Ownership or Modes for Directory

For convenience, I use public/private key ssh authentication to login remote servers. All servers work out fine but just this one particular server did not work out. It has been bothering me for a while and finally I got fed up today and decided to solve it once for all. If you have the same problem, please check below for description and steps to solution!

Description

The content of /var/log/secure from remote server actually points out cause of the problem already.
SSH Authentication Refused Bad Ownership or Modes for Directory
SSH Authentication Refused Bad Ownership or Modes for Directory

We can see clearly that the permission of the directories is wrongly set, so all we have to do is set it correctly!
The main point to get all these things work is NOT to have write permission set to the group!
According to CentOS wiki, 700 is the preferred permission to the directory but after testing, it will be fine as long as write permission is not set to group.

Solution steps

Assume permission of my directories are set as below
SSH Authentication Refused Bad Ownership or Modes for Directory

Use commands below to set direcotory’s permission correctly.

chmod 700 ~/.ssh
chmod 700 ~/


SSH Authentication Refused Bad Ownership or Modes for Directory

This solved my problem, does it solve yours?

REFERENCES:
HowTos/Network/SecuringSSH - CentOS Wiki
SSH Authentication refused: bad ownership or modes for directory - Dave Perrett