Github公钥的公共URL是什么?
我听说github上的所有用户都有一个公共URL,您可以访问他们的公钥,或者他们可以提供所有公钥的URL。这是真的?如果是这个网址是什么。它还存在于bitbucket中吗?
I heard that there was a public URL for all users on github where you can access their public keys or they can supply that URL of all their public keys. Is this true? If so what is that URL. Does it exist for bitbucket as well?
您可以得到:
curl https://github.com/<username>.keys
将<用户名>
替换为GitHub用户的实际用户名。
Replace <username>
with the actual username of the GitHub user.
当您将登录权限设置为其他服务器时很有用。只需将其输出保存到〜/ .ssh / authorized_keys
中即可。从命令行追加到最后:
This is useful when you set login permission to other servers. Just save its output into ~/.ssh/authorized_keys
. To append it to the end from the command line:
curl https://github.com/<username>.keys | tee -a ~/.ssh/authorized_keys
也可以使用Github API完成
It can also be done using Github API
curl -i https://api.github.com/users/<username>/keys
对于位桶,您可以使用以下内容:
For bit bucket you can use the following
curl -i https://bitbucket.org/api/1.0/users/<username>/ssh-keys