修复 Authentication refused: bad ownership or modes for directory 错误

当自动登录时在log看到 Authentication refused: bad ownership or modes for directory 这个错误,表明 ~/.ssh 目录及文件的权限出了问题。

修复方法,用 chmod 更新到合适的权限:

chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys