SSH agent setup for multiple Bitbucket account

SSH agent setup for multiple Bitbucket account

DevOps Jul 14, 2023

First of all, set up your SSH key both locally my-id-rsa

and also on the remote bitbucket web UI my-id-rsa.pub

Adding bitbucket.org-suffix

For project aaaaa you just adding -aaaaa after the domain name

git clone git@bitbucket.org-aaaaa:minor_digital/my-project.git

Edit config file

Edit your config file reside in your home ~/.ssh/config folder.

Create new one if there is no any.

Note the the Host MUST match with your host in git command

Host bitbucket.org-aaaaa
    Hostname bitbucket.org
    User git
    IdentityFile ~/.ssh/my-id-rsa

What need to be matched

  1. @bitbucket.org-aaaaa in the git command
  2. Config file Host bitbucket.org-aaaaa

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.