Bad owner or permissions on /home/xxxxx/.ssh/config 问题

本文记录了一次因SSH配置文件权限错误导致无法从远程仓库拉取代码的问题,并详细描述了解决过程。通过调整$HOME/.ssh/config文件的权限,从644更改为600,成功解决了错误并恢复了代码拉取功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天拉代码不知道之前做了啥操作,一直拉不下来且报如下错误:
./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.

如上操作后,可以正常拉代码了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kaira88

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值