Check the settings for SSH keys
$ CD ~/.ssh/
If "No such file or directory" is displayed, skip to step three, otherwise continue.
Back up and remove the original SSH key settings
If a key file already exists, you need to back up the data and delete it
$ lsid_rsa id_rsa.pub known_hosts$ mkdir key_backup$ cp id_rsa* key_backup/$ rm id_rsa*
Generate a new SSH key
Enter the following code, you can generate a new key file, only need to use the default settings, when you need to enter the file name, the carriage return
$ ssh-keygen-t Rsa-c"your e-mail @qq.com"Generating Public/private RSA key pair. Enter fileinchWhich to save the key (/c/users/wx/.ssh/id_rsa): Enter Passphrase (empty forno passphrase): Enter same passphrase Again:your identification has been savedinch/c/users/wx/.ssh/Id_rsa. Your public key has been savedinch/c/users/wx/.ssh/id_rsa.pub.The Key fingerprint is:1d:cc:7e:b3:7e: the: f7:ab:c6: the: About: the: +: -: bc:8c your e-mail @qq.comthe key's Randomart image is:+--[RSA 2048]----+| . || o+ || +o + || OE.O o.o| | S o O..+|| . O. o| | o....| | . ooo | | o=. oo|+-----------------+
for no passphrase): Here you can enter a password to verify at login
Add SSH key to GitHub
Using the text Editing tool to open the Id_rsa.pub file, if you do not see this file, you need to set the display hidden file. Accurately copy the contents of this file to ensure the success of the setup.
Click the Settings button on the GitHub home page, select SSH keys, paste the contents of the copy, then click the Add Key button to select the title.
Test it.
Enter the following command to test whether the setting is successful (first logon)
$ ssh-T [Email protected]the authenticity of host'github.com (192.30.255.112)'Can't be established.RSA Key fingerprint is -: -: Ac:a5: the: -: 2d: $: the: 1b: About: 4d:eb:df:a6: -. Is you sure want to continue connecting (yes/no)? Ywarning:permanently added'github.com,192.30.255.112'(RSA) to the list of known hosts. Enter Passphrase forKey'/c/users/dyf/.ssh/id_rsa': (If you need to enter a password in the previous step) Hi dyf007! You've successfully authenticated, but GitHub does not provide shellAccess.
Reference: http://codepub.cn/2015/06/02/Windows-client-configuration-of-SSH-public-key-on-GitHub/(Here are instructions for setting up multiple Sshkey)
Windows client configures the SSH public key for GitHub