How to add a ssh-key to your github account
Related Posts
Step by step guide
Generate your SSH key for your convenient git work
If you don’t already have an SSH key, you must generate a new SSH key. If you’re unsure whether you already have an SSH key, check for existing keys.
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDltFNAyuz2eRra1NIdYC9Nh/3e/OQh4JXXuvFTv/s
...
4WYyGjrFOrpLMhDvO9Zo8o2tChlv1GxYpBMMAOHS1DEHUeGp3nVWF12qAT5tntVc5THy7Xw== coolwind@hotmail.co.kr
If you don’t want to reenter your passphrase every time you use your SSH key, you can add your key to the SSH agent, which manages your SSH keys and remembers your passphrase.
Paste the text below, substituting in your GitHub email address.
ssh-keygen -t rsa -b 4096 -C "your_github_email@example.com"
This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair. When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.
Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter] At the prompt, type a secure passphrase. For more information, see “Working with SSH key passphrases”. Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
Now, check for your new generated key.
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDltFNAyuz2eRra1NIdYC9Nh/3e/OQh4JXXuvFTv/s
...
4WYyGjrFOrpLMhDvO9Zo8o2tChlv1GxYpBMMAOHS1DEHUeGp3nVWF12qAT5tntVc5THy7Xw== coolwind@hotmail.co.kr
Add the SSH key to your GitHub account
-
Go to Settings on your GitHub Profile
-
Find the button saying New SSH key and Click it
-
Paste the string you’ve got from the terminal and set a nickname for the SSH key
It’s done!