SlideShare a Scribd company logo
1 of 6
Download to read offline
LinuxDady.Com
On GitHub add ssh key step by step
for beginners
For more information visit
https://linuxdady.com
On GitHub add ssh key for
repository communication
BY DEEPAK KUMAR · PUBLISHED OCTOBER 28, 2019 · UPDATED OCTOBER 28, 2019
On GitHub add ssh key means to add our public key on GUI portal of GitHub
for communication without password. I think everyone knows about it there
are mainly two way to communicate with our repository on code management
server that is SSH or HTTP method.
But if we will not add ssh key then we have to give password every time for push
or pull our code in our public or private repository that’s become very hectic
task. So, to avoid this we have to add ssh key on GitHub GUI dashboard first.
GitHub add ssh key
I think everyone knows about use case of public and private key. So, we are
going to create public and private key for communication. I want to tell you that
we will add public key on GitHub, and we will use private key for
communication. Mind it there is no need to generate new private key for every
developer. We can use same private key for every developer just distribute that
key to new upcoming developers.
Because we know very well ssh key is not system based they are pair-based
means if you added public ssh key on GitHub then anyone can communicate
with your GitHub repository if he/she have private key. So, use below command
to create key pair.
1 ssh-keygen
Now go to below location and check our private and public key has been created
properly or not.
1
2
3
cd /root/.ssh/
ls
cat id_rsa.pub
[Click & Read:– What is git and basic terminology for DevOps
engineers]
[Click & Read:– Explain git workflow for beginners step by
step]
As we have checked our private and public key pair has been properly created.
Now Copy public key and paste it on GUI GitHub Portal as shown below.
Click on Add SSH key button. Then it will ask for password to confirm you are
the right or wrong person that are adding key.
Create Git repository and push
Our key has been added now come on the terminal and try to push code in repo.
In my case I am creating fresh git repo and will try to push that repo. Let’s do it.
1
2
3
4
5
6
mkdir git-repo
git init
ls -a
touch git-repo
echo hello > git-repo
git add .
Follow below steps only once those developers which are new and committing
first time. If you are not new ignore these steps.
1
2
git config --global user.email harry@gmail.com
git config --global user.name "harry"
After adding name and mail id developers can easily able to commit and push
their changes into repository.
1
2
3
git commit -m "This is harry first commit"
git remote add origin git@github.com:KaushikDeepakkumar/git-repo.git git
push origin master
But if we will not add ssh public key pair and will try to push then it will show
below error.
All about add ssh key on GitHub
Mind it we can also save our credential in a file a call them there is not need of
type username and password every time. But when safety is your priority then
go with ssh key. Then is more secure than passing credential. Still anyone have
query on topic GitHub add ssh key write me in comment box. I will try my best
to resolve them.
Interview question on GitHub add ssh key
1. Can all developers use same private and public key for GitHub
repository?
2. If anyone got our private key what he/she can do?
3. Explain the repository communication method?
4. Funny question interviewer often asks to devops engineer for to check
presence of mind — what is port number of GitHub? Please answer this
in comment box. Our team is waiting your answer.

More Related Content

What's hot

Gerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyGerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyLuca Milanesio
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewLuca Milanesio
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Using the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketUsing the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketLiam Dempsey
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GITGhadiAlGhosh
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, futureLuca Milanesio
 
Git, github and the hacktober fest
Git, github and the hacktober festGit, github and the hacktober fest
Git, github and the hacktober festUtkarshRaj83
 
Contributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestContributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestCheah Eng Soon
 
Visual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionVisual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionWarren Thompson
 
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"South Tyrol Free Software Conference
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldRachael L Moore
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHubNishan Bose
 
Webinar: Arbeiten mit Git und GitHub
Webinar: Arbeiten mit Git und GitHubWebinar: Arbeiten mit Git und GitHub
Webinar: Arbeiten mit Git und GitHubwasmitweb GmbH
 

What's hot (19)

Git first contributions
Git first contributionsGit first contributions
Git first contributions
 
Github tutorial1
Github tutorial1Github tutorial1
Github tutorial1
 
Gerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and GroovyGerrit Code Review: how to script a plugin with Scala and Groovy
Gerrit Code Review: how to script a plugin with Scala and Groovy
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code Review
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Using the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketUsing the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to Bitbucket
 
Getting started With GIT
Getting started With GITGetting started With GIT
Getting started With GIT
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
 
Git, github and the hacktober fest
Git, github and the hacktober festGit, github and the hacktober fest
Git, github and the hacktober fest
 
Contributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestContributing to Open Source #Hacktoberfest
Contributing to Open Source #Hacktoberfest
 
Visual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionVisual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 Introduction
 
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
SFScon17 - Daniele Gobbetti: "Free software projects on GitHub and DMCA"
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Git 's way
Git 's wayGit 's way
Git 's way
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component world
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
Webinar: Arbeiten mit Git und GitHub
Webinar: Arbeiten mit Git und GitHubWebinar: Arbeiten mit Git und GitHub
Webinar: Arbeiten mit Git und GitHub
 

Similar to Github add ssh key

Similar to Github add ssh key (20)

Setting up github and ssh keys.ppt
Setting up github and ssh keys.pptSetting up github and ssh keys.ppt
Setting up github and ssh keys.ppt
 
Hello Git
Hello GitHello Git
Hello Git
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
 
introductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdfintroductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdf
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Git Hub Platform
Git Hub PlatformGit Hub Platform
Git Hub Platform
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
Git ongithub
Git ongithubGit ongithub
Git ongithub
 
Github developing stack
Github developing stackGithub developing stack
Github developing stack
 
Github github-github
Github github-githubGithub github-github
Github github-github
 
Git/GitHub
Git/GitHubGit/GitHub
Git/GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Git Mastery
Git MasteryGit Mastery
Git Mastery
 
GWT Contributor Workshop
GWT Contributor WorkshopGWT Contributor Workshop
GWT Contributor Workshop
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)
 
Git hub visualstudiocode
Git hub visualstudiocodeGit hub visualstudiocode
Git hub visualstudiocode
 
16 Git
16 Git16 Git
16 Git
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 

Github add ssh key

  • 1. LinuxDady.Com On GitHub add ssh key step by step for beginners For more information visit https://linuxdady.com
  • 2. On GitHub add ssh key for repository communication BY DEEPAK KUMAR · PUBLISHED OCTOBER 28, 2019 · UPDATED OCTOBER 28, 2019 On GitHub add ssh key means to add our public key on GUI portal of GitHub for communication without password. I think everyone knows about it there are mainly two way to communicate with our repository on code management server that is SSH or HTTP method. But if we will not add ssh key then we have to give password every time for push or pull our code in our public or private repository that’s become very hectic task. So, to avoid this we have to add ssh key on GitHub GUI dashboard first. GitHub add ssh key I think everyone knows about use case of public and private key. So, we are going to create public and private key for communication. I want to tell you that we will add public key on GitHub, and we will use private key for communication. Mind it there is no need to generate new private key for every developer. We can use same private key for every developer just distribute that key to new upcoming developers. Because we know very well ssh key is not system based they are pair-based means if you added public ssh key on GitHub then anyone can communicate
  • 3. with your GitHub repository if he/she have private key. So, use below command to create key pair. 1 ssh-keygen Now go to below location and check our private and public key has been created properly or not. 1 2 3 cd /root/.ssh/ ls cat id_rsa.pub [Click & Read:– What is git and basic terminology for DevOps engineers] [Click & Read:– Explain git workflow for beginners step by step]
  • 4. As we have checked our private and public key pair has been properly created. Now Copy public key and paste it on GUI GitHub Portal as shown below. Click on Add SSH key button. Then it will ask for password to confirm you are the right or wrong person that are adding key.
  • 5. Create Git repository and push Our key has been added now come on the terminal and try to push code in repo. In my case I am creating fresh git repo and will try to push that repo. Let’s do it. 1 2 3 4 5 6 mkdir git-repo git init ls -a touch git-repo echo hello > git-repo git add . Follow below steps only once those developers which are new and committing first time. If you are not new ignore these steps. 1 2 git config --global user.email harry@gmail.com git config --global user.name "harry" After adding name and mail id developers can easily able to commit and push their changes into repository. 1 2 3 git commit -m "This is harry first commit" git remote add origin git@github.com:KaushikDeepakkumar/git-repo.git git push origin master But if we will not add ssh public key pair and will try to push then it will show below error.
  • 6. All about add ssh key on GitHub Mind it we can also save our credential in a file a call them there is not need of type username and password every time. But when safety is your priority then go with ssh key. Then is more secure than passing credential. Still anyone have query on topic GitHub add ssh key write me in comment box. I will try my best to resolve them. Interview question on GitHub add ssh key 1. Can all developers use same private and public key for GitHub repository? 2. If anyone got our private key what he/she can do? 3. Explain the repository communication method? 4. Funny question interviewer often asks to devops engineer for to check presence of mind — what is port number of GitHub? Please answer this in comment box. Our team is waiting your answer.