我在我的主目录 /vincent
中为 github 设置了一个 ssh key .我想克隆一个存储库到我的/var/www/html
目录。看来, key 在我的主目录之外是未知的。我需要做什么,才能在 /var
中与 github 连接目录?
编辑:
使用 ssh 克隆时,我从 github 收到以下错误
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
最佳答案
你可以输入
export GIT_SSH_COMMAND='ssh -Tv'
git clone ...
然后,您将看到 ssh 在哪里寻找您的 key 。所述 key 应在
~/.ssh/id_rsa
, 与 ~
正常/home/vincent
(不只是 /vincent
)
关于ubuntu - 在 Ubuntu 上的/var 目录中使用 ssh key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63401440/