
# 使用SSH密钥无法登录，报错：Authentication refused: bad ownership or modes for directory /root
#### 问题描述
SSH密钥无法登录，报错Authentication refused: bad ownership or modes for directory /root
图1SSH密钥无法登录   
![](https://support.huaweicloud.com/trouble-ecs/zh-cn_image_0000001925605177.png "点击放大")
#### 可能原因
根据日志报错，提示/root这个目录权限问题，排查/root目录，以及目录内的.ssh，.ssh目录内authorized_keys的权限以及属主属组。
#### 处理方法
修改/root目录的权限以及属主属组后，SSH恢复正常。
![](https://support.huaweicloud.com/trouble-ecs/zh-cn_image_0000001879686284.png "点击放大")
