Setting up SSH key without using id_rsa for Bitbucket
05 Dec 2018These are the the steps to generating a new SSH key and testing Bitbucket ssh keys on Windows.
This set up will allow you to use a custom ssh key specifically for Bitbucket, without having to change your id_rsa key.
- Run ssh-keygen to create a new ssh key
- Use bitbucket_rsa for key name
- Don’t specify a password, if you don’t want to enter it every time.
-
Add the public key to the ssh-keys section inside of Bitbucket (use the file with the .pub extension)
-
Create ssh config file with the following settings for bitbucket.org
FileName: ~.\ssh\config
Host bitbucket.org IdentityFile ~/.ssh/bitbucket_rsa IdentitiesOnly yes
-
Test your new key against Bitbucket to see if it uses the correct file
ssh -T git@bitbucket.org
-
Verify you’ve successfully logged in.
logged in as <UserName>. You can use git or hg to connect to Bitbucket. Shell access is disabled.
Now, you should be able to push / pull from Bitbucket without needing to specify your ssh key:
SSH will use the correct key when connecting to bitbucket.org.