Saturday, August 29, 2026

How to Create a SSH Key for BitBucket

Step 1: Generate an SSH Key

  • Open PowerShell or your command prompt.

  • Run the following command to generate a new SSH key pair: ssh-keygen -t rsa -b 4096

  • Press Enter through the default prompts to save the key to your user profile directory.

  • Run this command to copy your new public key directly to your clipboard: Get-Content ~/.ssh/id_rsa.pub | Set-Clipboard

Step 2: Add the Key to Bitbucket

  • Log in to Bitbucket and navigate directly to your account SSH keys settings page at https://bitbucket.org/account/settings/ssh-keys/.

  • Click Add key and paste the public key into the key field using one of the following methods:

    • Option A (Clipboard): Paste the key from your clipboard using right-click -> Paste or Ctrl + V.

    • Option B (Manual Copy): If needed, navigate to your user profile folder (typically C:\Users\YourUsername\.ssh\), open the id_rsa.pub file in a text editor, and manually copy the entire text content.

  • Type a label like SSH_BitBucket in the label field, and click Add key.

Step 3: Update Your Local Repository Remote URL and Pull

  • Open a terminal inside your local repo folder.

  • Run the following command to update your repository remote to the SSH format: git remote set-url origin git@bitbucket.org:xxxxx-llc/lib_altium.git

  • Run the following command to test the connection and pull: git pull

  • Type yes if prompted to accept the host fingerprint, and your repository will sync securely.

Step 4: Configure TortoiseGit (If Applicable)

  • If you use TortoiseGit for graphical operations, update it to use the native Windows OpenSSH client instead of PuTTY:

    • Right-click your repository folder and select TortoiseGit -> Settings.

    • Navigate to the Network section on the left sidebar.

    • Locate the SSH client path field and browse to: C:\Windows\System32\OpenSSH\ssh.exe

    • Click Apply and OK to save your changes.