今天拉代码不知道之前做了啥操作,一直拉不下来且报如下错误:
./repo/repo init -u ssh://igerrit.storm:29418/Src/iauto-things/manifests -b xxx/master -m default.xml
Get ssh://igerrit.storm:29418/Src/xxxxx/manifests
Bad owner or permissions on /home/xxxxx/.ssh/config
Bad owner or permissions on /home/xxxxx/.ssh/config
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
后来去.ssh/config下查看配置,一看呗清空了,可能是之前拉另外一个项目时候,做了一些操作导致,所以把配置再加上,再去拉代码还是报上面错误:
最后查找解决方法:
The ssh with RHEL 4 is a lot more anal about security checking. In my case, it was the fact that $HOME/.ssh/config was group-writable which was causing it to barf. To fix:
$ cd ~/.ssh
$ chmod 600 *
Note that this error message is kind of stupid, since $HOME/.ssh had permissions 700 on it, and $HOME had 750 permissions on it. If any process managed to evade those permissions, changing the permissions on the config file would be similarly defeated.
如上操作后,可以正常拉代码了