Git當(dāng)中如何創(chuàng)建SSH Key

創(chuàng)建SSH Key
馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號: 73203。



馬克-to-win:因?yàn)楸镜豨it倉庫和遠(yuǎn)程的github倉庫之間是通過ssh加密傳輸?shù)?,所以需要?chuàng)建一個SSH Key。

注意下面的實(shí)驗(yàn)中,Documents and Settings在win7下面是不能訪問的,由于安全問題, 參考我目錄下的文章,看怎么解決。

Windows下打開Git Bash,輸入以下命令

ssh-keygen -t rsa -C iscp9158_work@163.com

console里面的輸出結(jié)果是:




$ ssh-keygen -t rsa -C iscp9158_work@163.com
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,將其中的內(nèi)容復(fù)制下來(這就相當(dāng)于一把鑰匙,將來傳輸時用),下面是我的: