How to Set Up SSH Key for GitHub and Your Local PC/Server

SSH-KEY Authentication With GitHub

These pieces of software are necessary to create a proper communication channel using the SSH protocol (DigitalOcean). Essentially, SSH keys are an authentication method used to gain access to an encrypted connection between systems and then ultimately use that connection to manage the remote system.

Open the Terminal for Linux users. For Windows users, open PowerShell or Gitbash and type the command shown below:

ssh key generation

Click enter to ask a question for generating public/private rsa key pair then click Enter (Note the ssh-key generated path as /root/.ssh/)

confirm the path to generate ssh-key

After that, you will get a success message in your console. Then we need to view and copy the public key, to our GitHub account for which we need to change our directory to the above path where our key file is stored. For me the path is /root/.ssh/.

cd /root/.ssh/

Then type ls for listing the folder/files inside the current directory and you will get the folders and files inside the directory. Then open the public key where you can find two keys: one is private (id_rsa) and another one is the public key ( For opening the key use the below command:


Which will open your key on the console:

Public SSH-KEY

Copy the entire code. In my case, I copied from ssh-rsa to 01 and pasted it in the GitHub console. In the console, go to the account section in the settings and click on the SSH and GPG Key. Then click on the New SSH Key and you will get a console like the below image. There, type the Title as Your PC Name and Paste the code you copied in the Key section.

Add SSH Key to Github

Then Click Add SSH Key and You are done!

That's how it’s done. Thank you for reading.

More content at




DevOps Engineer / Solution Architect- Calicut

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Feature Flags are the solution

iOS unit testing, a faster, reliable and higher code coverage approach!

Why a Software Development Project Will Benefit from a Business Analyst

Crunch Pokemon Data with Python and Deta Base

Electronic Rulemaking

{UPDATE} Simulator Docking Hack Free Resources Generator

101 Create your first Substrate blockchain

Internet components using metaphors

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshay Krison

Akshay Krison

DevOps Engineer / Solution Architect- Calicut

More from Medium

How to create an account in GitLab | Create your Project in GitLab

Let’s Encrypt — Install Free SSL | Shared Hosting

How to Exclude Scanning Files in Sonarqube