SSH agent setup for multiple Bitbucket account
codemonday
SSH agent setup for multiple Bitbucket account
move up
linefacebookx
move up
linefacebookx

SSH agent setup for multiple Bitbucket account

Jul 14, 2023
DevOps

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