连接到远程服务器 ssh 并从 GIT 克隆

connected to remote server ssh and cloning from GIT

我的问题很简单

我已通过 ssh 连接到我的远程服务器。 我想在我的远程服务器上使用 ssh 密钥制作一个 git 克隆... 每次

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

我已经在我的远程服务器私有和 public 中生成了我的 ssh。 我在 gitlab 中添加了我的 public 密钥。

但是我可能忘记了一步。

在此先感谢您的帮助。

如果您确定您的远程服务器中有您的密钥,并且它具有适当的权限(600 或 400 即可)。只是:

ssh-add route/to/your/key

你应该能够正确克隆。

注意:如果您的 SSH 代理不是 运行,请使用:

启动它
eval "$(ssh-agent -s)"