Git克隆不能在Linux服务器上使用HTTPS和SSH



无法从Linux (Ubuntu 18)服务器(DigitalOcean)克隆我自己的git存储库。我尝试过SSH和HTTPS,但没有运气。以下是我所遵循的步骤:

  1. 使用ssh-keygen生成密钥
  2. 将该密钥放在Github上的SSH-keys

当我运行ssh -T git@github.com时,它回复Hi jfBiswajit!您已经成功验证,但GitHub不提供shell访问。

使用SSH克隆Git:

Cloning into '.'...
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.

使用HTTPS克隆Git:

Cloning into '.'...
Username for 'https://github.com': jfbiswajit
Password for 'https://jfbiswajit@github.com':
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

我提供了正确的用户名和密码。我不明白它出了什么问题。如有任何帮助,我将不胜感激。

进入https://github.com/settings/tokens并生成一个令牌

并在克隆存储库时输入生成的令牌而不是密码。

我会检查我的ssh-agent是否在运行

eval "$(ssh-agent -s)"

,并将键添加到其中。通过执行

检查代理中的任何键
ssh-add -l

请按照此处的官方指南为座席添加密钥。

最新更新