Github 学习之sshkey创建

终端截屏:

TechsundeMacBook-Pro:~ macbook$ ssh-keygen -t rsa -C "*****@163.com"

Generating public/private rsa key pair.

//输入用户名密码

Enter file in which to save the key (/Users/macbook/.ssh/id_rsa): 

Enter passphrase (empty for no passphrase): 

Enter same passphrase again: 

Your identification has been saved in /Users/macbook/.ssh/id_rsa.

Your public key has been saved in /Users/macbook/.ssh/id_rsa.pub.

The key fingerprint is:

*************************  *******@163.com

The key's randomart image is:

+--[ RSA 2048]----+

|       o         |

|    . . o        |

|     +  ...      |

|    . o o+ . +   |

|       +Soo + o  |

|       .o.E.   o |

|        ..      o|

|         oo  . ..|

|          o+o   .|

+-----------------+

TechsundeMacBook-Pro:~ macbook$ eval "$(ssh-agent -s)"

Agent pid 4961

TechsundeMacBook-Pro:~ macbook$ ssh-add ~/.ssh/id_rsa

Enter passphrase for /Users/macbook/.ssh/id_rsa: 

Identity added: /Users/macbook/.ssh/id_rsa (/Users/macbook/.ssh/id_rsa)

//复制其中的值到github网站设置-》sshkey

TechsundeMacBook-Pro:~ macbook$ vim ~/.ssh/id_rsa.pub

//验证是否成功

TechsundeMacBook-Pro:~ macbook$ ssh -T [email protected]

Hi *******! You've successfully authenticated, but GitHub does not provide shell access.

TechsundeMacBook-Pro:~ macbook$ 

猜你喜欢

转载自blog.csdn.net/Hitourlee/article/details/43409015