【发布时间】:2016-09-29 12:42:35
【问题描述】:
我在使用 sudo git pull origin master 时遇到问题,我生成了一个 SSH-KEY 并将它们添加到 Gitlab 上,但是我的命令不起作用...
命令:
****:/var/www/****$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQ****4rZZwQjt0VmJdb8zGQwcNMsYAZTCssjNw1UQZqTSUZRy8uK76W9h9kXsVgggAf1EgUKaxaKFFMF50TtugkdsSIGq4/ze9vYDrEVy4rc4aOTPuBNI9X01JRbvUdRtOajmC8WEq5NdLUwXCtg/Cga2uZ ****
****:/var/www/****$ sudo git pull origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
****:/var/www/****$
【问题讨论】:
-
可能 root 的 ssh 未配置为使用您在
~/.ssh中的用户密钥。 -
好的,我该怎么办?
标签: git ssh gitlab ssh-keys ssh-keygen