Git当中如何创建SSH Key

4.创建SSH Key

因为本地git仓库和远程的github仓库之间是通过ssh加密传输的,所以需要创建一个SSH Key。

注意下面的实验中,Documents and Settings在win7下面是不能访问的,由于安全问题, 参考我目录下的文章,看怎么解决。

Windows下打开Git Bash,输入以下命令

ssh-keygen -t rsa -C [email protected]

console里面的输出结果是:

$ ssh-keygen -t rsa -C [email protected]
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Documents and Settings/dell/.ssh/id_rsa):
Created directory '/c/Documents and Settings/dell/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Documents and Settings/dell/.ssh/id_rsa.
Your public key has been saved in /c/Documents and Settings/dell/.ssh/id_rsa.pub.

dell@dell MINGW32 ~
$

找到.ssh文件夹,打开就可以看到两个文件id_rsa和id_rsa.pub,

打开id_rsa.pub,将其中的内容复制下来(这就相当于一把钥匙,将来传输时用),下面是我的:

版权保护,原文出处:http://www.mark-to-win.com/index.html?content=Frame/frameUrl.html&chapter=Frame/Git_web.html#CreateSSHKey

猜你喜欢

转载自blog.csdn.net/mark_to_win/article/details/88713624
今日推荐