DevOps Git

Set up additional SSH keys for Git

Why?

While using the same password on multiple sites makes your accounts less secure, most of the time you can use the same SSH key for multiple accounts. However, there are specific situations when you’ll need to set up more than one SSH key:

  • You have two different Bitbucket Cloud accounts. For example, if you have a work-related Bitbucket account and a personal Bitbucket account, each account must have its own SSH key.
  • You’re using two different computers to log in to the same account.
  • You want to execute DVCS actions on a repository with a script that uses a public key with an empty passphrase, allowing it to run without human intervention.

How?

In order to add the additional SSK keys for git, please follow the steps below.

1. Generate your new SSH key. In place of <username>, enter the username of the Bitbucket/Github account for which you’re creating the SSH key.

`ssh-keygen -f ~/.ssh/<username> `

2. Add your new SSH key to your account. Make sure you’re adding it to the right account.

`ssh-add ~/.ssh/<username>`

3. Add the public key to your Bitbucket settings

Resources:

https://confluence.atlassian.com/bitbucket/set-up-additional-ssh-keys-271943168.html

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *