Author: Yue-Wen FANG
Contact: fyuewen@gmail.com
Revision history: created in 16th, December 2017, at Kyoto
On github help webpage (see Ref1), there is a simple introduction on generating the ssh key pairs.
Open your terminal (no matter it is on Cygwin or Linux or Wingw or any other virtual linux systems):
Beforing reading my note, I think you could have see kygen command like
ssh-keygen -t rsa -b 2048 -C "your_email@example.com"
The only difference is the bit we use. It determines the length of the generated kyes. You can use either on your favor.
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
At the prompt, type a secure passphrase. (usually I just Press enter)
Start the ssh-agent in the background.
Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.
ssh-add ~/.ssh/id_rsa
Sometimes you may have several different key pairs (that means you have several id_rsa files like id_rsa.home id_rsa.work), and you want to use them in some specific conditions, what should we do?
We can use the config file in ~/.ssh, if you don't find it, just create this config file.
You can folow this guide to set up your config file (see Ref2 or Ref3)
If you know Chinese, you can also read there blogs in which the authors showed their thoughts on config file:
http://blog.csdn.net/u013647382/article/details/47832559
In [ ]: