Add SSH key for github and bitbucket on one PC

Is it possible to use github and bitbucket refinancing on a personal computer.

If not, let me know any other options.

Thanks in advance.

+7
source share
4 answers

Yes it is. You tell git where the remote code lives from the configuration file for each repository. You can even click on GitHub and Bitbucket from the same repository if you want.

See here for more details: http://blog.lckymn.com/2013/03/11/git-push-to-pull-from-both-github-and-bitbucket/

One important element will be connected to each separately with SSH.

Your SSH keys must be in $HOME/.ssh and contain any number of keys. The default name for the SSH key is id_rsa (or similar, depending on the protocol used to create it).

Try to do:

 ls $HOME/.ssh 

... to see what is there.

I do what you ask about yourself, and for me it causes something like:

 github-personal github-personal.pub bitbucket-work bitbucket-work.pub known_hosts 

Where known_hosts is a file that contains a list of connected servers and their associated public keys. Other files that end in .pub are my own public keys, and the rest are my private keys.

You get the GitHub and Bitbucket keys by following the relevant tutorials:

+4
source

Definitely yes. First you can generate an ssh key pair, see How to generate , then go to .ssh , copy the contents of id_rsa.pub and paste github or bitbucket ssh into your customization area.

0
source

I use the Sourcefree Desktop Application and My Gitbash at the same time push my project to the Bitbucket and Github repository below, which I did

right click to open the bash shell of the folder you want to click First you need to create a key, I advise you to use the same ssh key

create key ssh-keygen -t rsa -C " your_email@example.com "

go to the folder directory, right-click and select git bash then run the following command one after another git init git add. git commit -m "first"

open the desktop application with the source code click + to open the local repo file create a repo on the bitpack then click the repo icon then click the repo icon to add the name: originbit url: "link to the repository you created"

For your bitbucket you should use both public ssh key and private ssh key if you want to use both public and private repository

Use the previously created ssh key go to the TOOLS icon of the sourcefree application Click on the download tab then save it with the extension .ppk keep the same key as the private key and the public key in the same directory do not enter patches yet, to avoid difficulties just save it.

so that it can be loaded into the competition icon

to create a new key go to the source TOOLS icon then click the create button ssh key change the lower number to 2048 but if you canโ€™t change it first create a new key, then drag the mouse around the selected column in the form of a zigzag or in any shape after creation. change 1048 to 2048 so that it can be received in ssh bitpack then recreate a new key then save it as a public key and private key

add the key to Pageant (check the desktop notification for this Pageant key icon) add the ssh private key and ssh public key

Go to your website and add the contents of two ssh keys name them differently

go back to bash shell

git status git add -A git pull originbit master git commit -m "modified code" git push originbit master

create repo on github Open Sourcefree desktop application copy repo url then click repo icon then click repo icon to add then click on sourcefree

0
source

Yes, on a personal computer, you can use both github and bitbucket repo.

You can configure multiple SSH profiles.

  • First generate your SSH keys. To generate the first key- from the root folder cd ~ / .ssh ssh-keygen f work_key , then enter ssh-keygen f work_key passphrase. To generate a second key- ssh-keygen f personal_key , then enter the passphrase of your choice.
  • Secondly, create your own hosts file to create your hosts files- touch known_hosts -Third Create your own configuration file to create your own touch config configuration file, it will look something like this

#Work account Host bitbucket.org HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa UserKnownHostsFile ~/.ssh/known_hosts IdentitiesOnly yes

#Personal account Host bitbucket.org HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa2 UserKnownHostsFile ~/.ssh/known_hosts IdentitiesOnly yes

-Then add your SSH key to bitbucket. Go to bitbucket, settings, then pbcopy < id_rsa.pub SSH keys pbcopy < id_rsa.pub (for copying the key) and paste it into bitbucket.

0
source

All Articles