http://blog.csdn.net/superxlcr/article/details/51354257
Very detailed: http://blog.csdn.net/binyao02123202/article/details/20130891
1. Introduction:
What is ssh: ssh is the abbreviation of Secure Shell (Secure Shell Protocol), a security protocol based on the application layer and the transport layer. In order to facilitate access to github, an ssh public key must be generated so that you do not have to enter a user name and password every time you access github.
Open the git command line
ls -al ~/.ssh
To see if an ssh key exists
Check the /.ssh directory to see if there is a public ssh key
Generally speaking, the public ssh key file names are as follows:
- id_dsa.pub
- id_ecdsa.pub
- id_ed25519.pub
- id_rsa.pub
2. Create an SSH key
After you check the existing ssh key, you can create a new ssh key:
open Git Bash and
enter this string:
$ ssh-keygen -t rsa -C "[email protected]"
After generating it, go to your local c: //username//.ssh folder and find two files, open the pub and copy it to github
4. Test the SSH key
$ ssh -T git@github.com
The solution to connect to host github.com port 22 bad file number appears during git configuration
http://blog.csdn.net/vvaaiinn/article/details/45075491
Is to add a config file in the same directory of your id_rsa, paste the following words into it
Host github.com
User vain
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443