git ssh authentication

How to Create and Setup SSH Authentication for BItbucket and Github

I want to setup ssh authentication keys for my GitHub and Bitbucket account. So that I can commit to those repositories without username and password. How can I achieve this?

Solution: You can setup a passwordless authentication to your repositories on Github and Bitbucket using ssh keys. Follow the steps given in this article carefully to set it up.

Create a Key Pair

First, you need to create a key pair using OpenSLL utility.

1 .CD in to .ssh folder of your system.

2. Create a public and private key pair. When prompted for options, just press enter to select the default options. Optionally you can set a passphrase for your key.

3. Copy the public key.

4. Head over to Github or Bitbucket settings page and in the ssh keys option, add the id_rsa.pub contents that you have copied.

5. Once you are done with adding the keys, you can test the ssh connection using the following commands. First time it will ask to accepts the fingerprint.

For bitbucket,

For Github,

Cloning Repo

An important thing to notice when cloning the repo is, you should clone the repo with ssh URL and not the https URL. If you clone with https URL, ssh authentication won’t happen and it will ask for username and password.

For example,

That’s it. Now you will be able to push to your repository without username or password.

Related

Installing and Setting up a WordPress on RHEL 7 / CentOS 7

Basic Requirements Step 1: Connect to the server using key or…

Read more

Issue: I have my Jenkins master and slave setup on AWS instance. I am build i have a maven deploy task to upload a…

Read more

How do I install the latest mongoDB database server and components in Redhat 7 or a centos 7 box? There are no…

Read more
About

The Best Tutorials & Tips to Speedup Your DevOps Workflow.

Created by Bibin Wilson.