提供从机器访问Github私人仓库的权限

时间:2019-10-10 12:30:14

标签: git github

我有一个私人的git repo,我正在管理该仓库,并且想提供机器访问权限(应用程序) 对此。我找不到任何提供某种令牌的条目,我只是看到webhook和deploy keys(对于应该从何处提供密钥的部署密钥?如何生成密钥?), 我想生成一些令牌,并提供该令牌以使程序对它具有读取权限,该怎么做?

我认为这是在 user 的范围内,但我需要在存储库的范围内……

https://blog.openshift.com/private-git-repositories-part-3-personal-access-tokens/#targetText=To%20create%20a%20personal%20access,and%20enable%20the%20repo%20checkbox

https://github.blog/2015-06-16-read-only-deploy-keys/

我没有按钮add deployed keys,因为我还没有任何按键 我只有按钮add key

https://superuser.com/questions/1314064/read-only-access-to-github-repo-via-ssh-key

我尝试用

生成

ssh-keygen -t rsa -b 4096 -C "user@mail.com"

并将生成的密钥放在密钥上,然后出现错误:

Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key

1 个答案:

答案 0 :(得分:1)

听起来您已将密钥的私密部分粘贴到了盒子中,而不是公用部分。如果要生成RSA SSH密钥,则您的私有部分可能在~/.ssh/id_rsa中,而公共部分可能在~/.ssh/id_rsa.pub中(请注意“ .pub”部分)。如果将密钥的公共部分粘贴到框中,则应该能够正常使用私有部分来访问存储库。