Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the public URL for the Github public keys

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?

like image 882
frazras Avatar asked Apr 22 '13 23:04

frazras


People also ask

Where do I put public key in GitHub?

To add an SSH key to your GitHub account, use the ssh-key add subcommand, specifying your public key. To include a title for the new key, use the -t or --title flag. If you generated your SSH key by following the instructions in "Generating a new SSH key", you can add the key to your account with this command.

Which public key does git use?

Since git just uses ssh to connect, it will use whichever key ssh would use to connect to the remote host.


1 Answers

You can get with:

curl https://github.com/<username>.keys 

Replace <username> with the actual username of the GitHub user.

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 

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: (This call requires authentication.)

curl -i https://bitbucket.org/api/1.0/users/<accountname>/ssh-keys 
like image 169
frazras Avatar answered Oct 19 '22 22:10

frazras