Adding SSH Keys into Github, Gitlab or Bitbucket

When working with Git repositories hosted on platforms like GitHub, Bitbucket, or GitLab, you may need to authenticate yourself to access your repositories. One way to do this is by using SSH keys, which are a secure way to connect to your repositories without having to enter your username and password each time.


Here's how to add an SSH key to your GitHub, Bitbucket, or GitLab account:

GitHub

  1. Open your terminal and generate a new SSH key by running the following command:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  1. Note: Replace your_email@example.com with the email address associated with your GitHub account.
  2. Press Enter when prompted to accept the default location for your SSH key.
  3. Enter a passphrase for your SSH key when prompted, or leave it blank if you don't want to use one.
  4. Open the id_rsa.pub file in your terminal or text editor and copy the contents of the file.
  5. In your GitHub account, click on your profile picture in the top-right corner, and then click "Settings."
  6. Click "SSH and GPG keys" in the left sidebar.
  7. Click the "New SSH key" button.
  8. Give your SSH key a title and paste the contents of your id_rsa.pub file into the "Key" field.
  9. Click the "Add SSH key" button.

Bitbucket

  1. Open your terminal and generate a new SSH key by running the following command:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  1. Note: Replace your_email@example.com with the email address associated with your Bitbucket account.
  2. Press Enter when prompted to accept the default location for your SSH key.
  3. Enter a passphrase for your SSH key when prompted, or leave it blank if you don't want to use one.
  4. Open the id_rsa.pub file in your terminal or text editor and copy the contents of the file.
  5. In your Bitbucket account, click on your avatar in the bottom-left corner, and then click "Bitbucket settings."
  6. Click "SSH keys" in the left sidebar.
  7. Click the "Add key" button.
  8. Paste the contents of your id_rsa.pub file into the "Key" field.
  9. Give your SSH key a label and click the "Add key" button.

GitLab

  1. Open your terminal and generate a new SSH key by running the following command:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  1. Note: Replace your_email@example.com with the email address associated with your GitLab account.
  2. Press Enter when prompted to accept the default location for your SSH key.
  3. Enter a passphrase for your SSH key when prompted, or leave it blank if you don't want to use one.
  4. Open the id_rsa.pub file in your terminal or text editor and copy the contents of the file.
  5. In your GitLab account, click on your avatar in the top-right corner, and then click "Settings."
  6. Click "SSH keys" in the left sidebar.
  7. Paste the contents of your id_rsa.pub file into the "Key" field.
  8. Give your SSH key a title and click the "Add key" button.

That's it! You've successfully added an SSH key to your GitHub. Please keep in mind that when using DeployBot, the SSH Key will be generated automatically, and the only thing that you might be asked would be to check if the key is added properly on the repository or not.


For more questions, you can reach us at support@deploybot.com 🙂

Still need help? Contact Us Contact Us