在使用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.
本文详细介绍了在使用SSH进行git的远程仓库操作时,遇到远端服务器要求输入密码的问题,并通过检查服务器的ssh日志文件,发现可能是文件夹读写权限设置不当导致。文章引用了一篇相关web页面的内容,提供了解决问题的方法:确保home目录只有自己可写,~/.ssh目录权限为700,authorized_keys文件权限为600。此外,还建议使用ssh_config文件中的StrictModes off来解决此问题。
1万+

被折叠的 条评论
为什么被折叠?



