【发布时间】:2016-01-21 06:58:01
【问题描述】:
当我在用户提示下使用 ssh 进行 git clone 时,它可以正常工作。
git clone ssh://URL.com/soft.git soft_git
ssh 密钥id_rsa 和id_rsa.pub 在/home/user/.ssh 下
我的目的是使用sudo 执行 git,但出现以下错误
Cloning into '/home/user/git/soft'...
Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我创建了一个文件夹 /root/.ssh 并将 ssh 密钥复制到其中,但我遇到了同样的错误
如何正确使用 sudo 执行 git。
【问题讨论】: