github ssh

"""
Generating a new SSH key
1:open git bash
2:Paste the text below, substituting in your GitHub email address.
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# this create a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
3.When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
# input the file name to save the key
Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]

4.At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
# enter the password
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

Adding your SSH key to the ssh-agent
# Before adding a new SSH key to the ssh-agent to manage your keys, you should have checked for existing SSH keys and generated a new SSH key.

1:ensure that the agent is running
# if you are using GIT for windows ,you can start it manually:
# start the ssh-agent in the background
eval $(ssh-agent -s)
# Agent pid 59566
2: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

3:Add the SSH key to your GitHub account.

4:After we added the SSH key, there was no explicit notification telling us that the binding was successful!But we can test it by typing SSH -T git@github.com in Git Bash

5:Generally, after adding the public key, many people will often encounter the following problem:

The authenticity of host 'github.com (192.30.252.128)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?

Because the known_hosts file is missing, and the IP execution content of github.com must be generated, as follows:
$ ssh git@github.com
Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.
PTY allocation request failed on channel 0
Hi ! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
"""

posted @ 2018-09-01 10:08  tny_leyon  阅读(178)  评论(0编辑  收藏  举报