fra*_*ras 31 git github bitbucket public-key
我听说github上的所有用户都有一个公共URL,您可以访问他们的公钥,或者他们可以提供所有公钥的URL.这是真的?如果是这样,该URL是什么.它也适用于bitbucket吗?
fra*_*ras 66
你可以得到:
curl https://github.com/<username>.keys
Run Code Online (Sandbox Code Playgroud)
替换<username>为GitHub用户的实际用户名.
当您将登录权限设置为其他服务器时,这非常有用.只需将其输出保存到~/.ssh/authorized_keys.要从命令行将其追加到末尾:
curl https://github.com/<username>.keys | tee -a ~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
它也可以使用Github API完成
curl -i https://api.github.com/users/<username>/keys
Run Code Online (Sandbox Code Playgroud)
对于位桶,您可以使用以下内容:(此调用需要身份验证.)
curl -i https://bitbucket.org/api/1.0/users/<accountname>/ssh-keys
Run Code Online (Sandbox Code Playgroud)
Mik*_*e R 10
gitlab 也以同样的方式工作。
https://gitlab.com/<username>.keys
Run Code Online (Sandbox Code Playgroud)
在 bash 脚本中也能很好地工作。
#GitProvider to fetch public keys (gitlab.com,github.com)
GitProvider="gitlab.com"
GitUsername="username"
curl https://${GitProvider}/${GitUsername}.keys | tee -a ~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
此外,这些还提供了一种检索用户 PGP 密钥的方法:
GitHub:
https://github.com/USER.keys
https://gitlab.com/USER.gpg
Run Code Online (Sandbox Code Playgroud)
亚搏体育app实验室:
https://gitlab.com/USER.keys
https://gitlab.com/USER.gpg
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14161 次 |
| 最近记录: |