施用SSH遇到Authentication Refused: Bad Ownership or Modes for Directory

使用SSH遇到Authentication Refused: Bad Ownership or Modes for Directory

      在使用SSH进行git的远程仓库操作时,远端服务器提示要求输入密码.这与之前的使用情况并不

相同.检查了服务器的ssh的日志文件/var/log/secure后,注意到类似下面的信息:

      Authentication refused: bad ownership or modes for directory /home/git/.ssh

 

      想来应该是文件夹读写权限的设置问题.在Google之后,找到下面这个web,与所遇问题是类似的:

      SSH Authentication Refused: Bad Ownership or Modes for Directory

      下面转贴来自其中的一段内容:

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


You can also get around this by adding StrictModes off to your ssh_config file, but I’d advise against it - fixing permissions is the way to go.