What Do I Do If "Authentication refused: bad ownership or modes for directory /root" Is Displayed and I Can't Log In to an ECS Using SSH Key?
Symptom
You cannot log in to an ECS using an SSH key, and the error message "Authentication refused: bad ownership or modes for directory /root" is displayed.
Possible Causes
Error information in logs indicates that the permission of the /root directory is incorrect. Check the permission, owner, and owner group of the /root directory, .ssh in the /root directory, and authorized_keys in the .ssh directory.
Solution
Change the owner, owner group, and permission of the /root directory to recover the SSH.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.