forked from Sonal0409/DevOps_ClassNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSSH_GITHUB
More file actions
23 lines (19 loc) · 865 Bytes
/
SSH_GITHUB
File metadata and controls
23 lines (19 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Go to any AWS instance
# sudo su -
# pwd ==> should be root
Generate the ssh key as mentioned below:
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
# ssh-keygen
# cd /root/.ssh ==> 2 files should be there id_rsa & id_rsa.pub
# eval "$(ssh-agent -s)" ===> start the ssh-agent in the background
# ssh-add ~/.ssh/id_rsa ====> Add your SSH private key to the ssh-agent
# cat id_rsa.pub =====> Copy the ssh public key to github
# Go to github ==> Settings
# go to SSH section on left side
# Click on Add new ssh key
# give a name as developer1
# paste the copies ssh public key from EC2-instance
# go back to ec2-instance
# cd
# git clone [email protected]:Sonal0409/myproject05Aug.git
# successfully able to clone , push to github without authentication.