Skip to content
Readerstacks logo Readerstacks
  • Home
  • Softwares
  • Angular
  • Php
  • Laravel
  • Flutter
Readerstacks logo
Readerstacks
How to add ssh keys to git or bit bucket

How to add ssh keys to git or bit bucket ?

Aman Jain, July 3, 2024July 3, 2024

If you’re a developer working with Bit bucket repositories, using SSH keys can make your workflow more secure and efficient. Instead of entering your username and password each time you interact with your repository, SSH keys provide a seamless and secure connection. In this guide, we’ll walk you through the process of setting up an SSH key for Bit bucket on a Windows machine.

Step 1: Check for Existing SSH Keys

Before generating a new SSH key, check if you already have an SSH key:

  1. Open Git Bash (you can install it from here).
  2. Run the following command to check for existing keys:
ls -al ~/.ssh

If you see files like id_rsa and id_rsa.pub, you already have SSH keys. You can use these or create a new pair.

Step 2: Generate a New SSH Key

If you need to generate a new SSH key:

  1. In Git Bash, generate a new SSH key pair by running:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Replace "your_email@example.com" with your actual email address.

  1. When prompted, press Enter to accept the default file location (/c/Users/your_user/.ssh/id_rsa).
  2. Optionally, enter a passphrase for added security.

Step 3: Add the SSH Key to the SSH Agent

  1. Start the SSH agent in the background:
eval "$(ssh-agent -s)"
  1. Add your SSH private key to the SSH agent:
ssh-add ~/.ssh/id_rsa

Step 4: Add the SSH Key to Your Bitbucket Account

  1. Copy the SSH public key to your clipboard:
clip < ~/.ssh/id_rsa.pub
  1. Log in to your Bit bucket account.
  2. Go to Personal settings (click on your avatar at the bottom left and select Personal settings).
  3. In the left-hand menu, select SSH keys.
  4. Click Add key.
  5. Paste your SSH public key into the Key field and give it a Label.
  6. Click Add SSH key.

Step 5: Test Your SSH Connection

  1. In Git Bash, run the following command to test your SSH connection:
ssh -T git@bitbucket.org
  1. You should see a message like:
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled.

Now your SSH key is set up for Bit bucket on Windows!

Conclusion

Congratulations! You have successfully set up an SSH key for Bitbucket on your Windows machine. This will streamline your workflow, making it easier and more secure to interact with your Bitbucket repositories. Happy coding!

Related

Devops BITBUCKETKEYSSh

Post navigation

Previous post
Next post

Related Posts

How to install MySQL in Ubuntu?

September 18, 2021September 18, 2021

MySQL is a most popular and open source relational database. it provides multi user support with a many storage engines. in this tutorial we are going to install MySQL in Ubuntu. Let’s begin with simple steps: Step 1 : Open terminal in Ubuntu and install MySQL package Here, we are…

Read More

What is apache web server and install on ubuntu?

August 28, 2021August 29, 2021

Apache is a web server which is used to serve the http request from a client computer. A client can open a webpage to view the website using web browsers like chrome, firefox etc. and browsers sent their requests to web servers like apache http server. How to install Apache…

Read More
Devops How to Install multiple versions of PHP?

How to Install multiple versions of PHP?

September 18, 2021September 21, 2021

Sometimes it’s required to install the different version of PHP rather then the default one of Ubuntu Repository System. To install the different version we will follow the basic steps before installation of PHP Step 1 : Add ppa:ondrej/php to Ubuntu system Open the terminal or ssh connection and then…

Read More

Aman Jain
Aman Jain

With years of hands-on experience in the realm of web and mobile development, they have honed their skills in various technologies, including Laravel, PHP CodeIgniter, mobile app development, web app development, Flutter, React, JavaScript, Angular, Devops and so much more. Their proficiency extends to building robust REST APIs, AWS Code scaling, and optimization, ensuring that your applications run seamlessly on the cloud.

Categories

  • Angular
  • CSS
  • Dart
  • Devops
  • Flutter
  • HTML
  • Javascript
  • jQuery
  • Laravel
  • Laravel 10
  • Laravel 11
  • Laravel 9
  • Mysql
  • Php
  • Softwares
  • Ubuntu
  • Uncategorized

Archives

  • May 2025
  • April 2025
  • October 2024
  • July 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • July 2023
  • March 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Recent Posts

  • Understanding High Vulnerabilities: A Deep Dive into Recent Security Concerns
  • Understanding High Vulnerabilities in Software: A Week of Insights
  • Blocking Spam Requests with LaraGuard IP: A Comprehensive Guide
  • Enhancing API Development with Laravel API Kit
  • Exploring the Future of Web Development: Insights from Milana Cap
©2023 Readerstacks | Design and Developed by Readerstacks
Go to mobile version