git sudo用户访问被拒绝

Abh*_*mar 0 linux git permissions ruby-on-rails-3

我跑的时候在我的身体里

git clone -q git@codebasehq.com:zzzz/yyyy/plat.git
Run Code Online (Sandbox Code Playgroud)

我可以克隆项目但是如果我跑了

sudo git clone -q git@codebasehq.com:zzzz/yyyy/plat.git
Run Code Online (Sandbox Code Playgroud)

并给出正确的密码

 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

知道为什么会这样吗?

shk*_*der 5

你的用户只是没有合适的公共密钥/root/.ssh.

您的用户肯定有一个~/.ssh,但root没有.