Skip to content

Instantly share code, notes, and snippets.

@sanjaykrishnan
Created December 24, 2019 05:22
Show Gist options
  • Save sanjaykrishnan/c39b76090a9b020b6d75c801b3dcf9ac to your computer and use it in GitHub Desktop.
Save sanjaykrishnan/c39b76090a9b020b6d75c801b3dcf9ac to your computer and use it in GitHub Desktop.
Instructions to add SSH key to repository
ssh-keygen -t rsa -b 4096 -C "your_email_id"
ssh-add ~/.ssh/id_rsa
copy content in .ssh/id_rsa.pub and paste in "Add SSH Key" option in your profile.
cd to your git repository.
git remote -v
git remote set-url origin <git_ssh_clone_url>
@sanjaykrishnan
Copy link
Author

sanjaykrishnan commented Dec 24, 2020

chmod 600 ~/.ssh/id_rsa

this command should be used if error like this occurs

@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for '/home/sanjay/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment