在我运行的时候在我的终端
git clone -q git@codebasehq.com:zzzz/yyyy/plat.git
我能够克隆该项目,但如果我运行
sudo git clone -q git@codebasehq.com:zzzz/yyyy/plat.git
并给出我得到的正确密码
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
知道这是为什么吗?
最佳答案
您的 root 用户在 /root/.ssh
中没有正确的公钥。
您的用户肯定在~/.ssh
中有一个,但root 没有。
关于linux - git sudo 用户访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11226694/