gpt4 book ai didi

linux - Phabricator git ssh clone 失败并出现需要密码错误

转载 作者:可可西里 更新时间:2023-11-01 11:49:11 24 4
gpt4 key购买 nike

root@jupiter:/home/jupiter/projects# git clone ssh://git@demo.jupiter.com/diffusion/TD/transcend.git Cloning into 'transcend'...
sudo: sorry, a password is required to run sudo
fatal: Could not read from remote repository.

我已经按照 manual 设置了 SSH .

我也有管道 ping 返回正确的消息:

root@demo:~# echo {} | ssh git@demo.jupiter.com conduit conduit.ping
{"result":"demo.jupiter.com","error_code":null,"error_info":null}

下面是我的 visudo 文件供引用。

Defaults        env_reset

Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"



### User privilege specification
root ALL=(ALL:ALL) ALL
git ALL=(ALL:ALL) ALL
git ALL=(root) SETENV: NOPASSWD: /usr/local/bin/git-upload-pack, /usr/local/bin/git-receive-pack

### Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

### Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

最佳答案

In this answer我发现您应该小心地在 sudoers 文件中为用户定义多个条目。您的第二个条目将覆盖 git 用户的第一个条目,并且第一个条目没有 NOPASSWD: 指令。

我也有同样的问题,在 git 用户的 sudoers 文件中只使用以下值解决了这个问题:

git     ALL=(ALL) NOPASSWD: ALL

这表明 git 用户正尝试将 sudo 用于 git-upload-pack 和 git-receive-pack 以外的命令。

也可能是您的 PATH 中有不止 1 个这样的命令,而 git 用户从另一个位置找到这些命令。

关于linux - Phabricator git ssh clone 失败并出现需要密码错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24059597/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com