DEV Community

Ibrar Hussain
Ibrar Hussain

Posted on

How to create additional SSH Keys

For your projects, if you are working with different bitbucket accounts you might face a scenario where Bitbucket complains that you have already used your SSH key before, in that case you need to create additional SSH key on your system. For example, if you have two Bitbucket accounts, you need to generate a new SSH key, meaning you'll have two keys in all.

Following are the steps:

Generate your new SSH key

Use the following command:

ssh-keygen -f ~/.ssh/<username>
Enter fullscreen mode Exit fullscreen mode

You can replace the <username> with the username of the Bitbucket account for which you're creating the SSH key.

Add SSH key to your account

Use the following command:

ssh-add ~/.ssh/<username>
Enter fullscreen mode Exit fullscreen mode

This will add your new SSH key to your account. Make sure you're adding it to the right account.

Now, you can use this new public SSH key to your Bitbucket account.

References:

Top comments (0)