2013-02-14 115 views
0

我已經在我的Windows上安裝了Cygwin終端。我試圖用命令克隆我們在linux服務器上的git倉庫:從Windows的git克隆

$ git clone ssh://some.server.com/somename 
Cloning into 'somename'... 
[email protected]'s password: 

我知道服務器中存在SSL證書。

我怎樣才能得到它沒有密碼連接?它如何考慮服務器上的證書?

+0

[ssh login without password](http://linuxproblem.org/art_9.html) – 2013-02-14 13:05:56

回答

1

副本,並從mathias kettner's tutorial

首先貼在登錄爲用戶,並生成一個認證密鑰對。不要輸入一個密碼:

[email protected]:~> ssh-keygen -t rsa 
Generating public/private rsa key pair. 
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'. 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa. 
Your public key has been saved in /home/a/.ssh/id_rsa.pub. 
The key fingerprint is: 
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 [email protected] 

現在使用ssh上B.創建一個目錄的〜/ .ssh爲用戶B(該目錄可能已經存在,這是很好的):

[email protected]:~> ssh [email protected] mkdir -p .ssh 
[email protected]'s password: 

最後追加的新的公共密鑰到b @ b:的.ssh/authorized_keys文件,並輸入b的密碼是最後一次:

[email protected]:~> cat .ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys' 
[email protected]'s password: 

從現在起,你可以爲b從A登錄到b,爲無密碼:

[email protected]:~> ssh [email protected] hostname 
B 
+0

我正在嘗試這個。你認爲它也應該在Windows上工作嗎? – Aris 2013-02-14 13:25:48

+0

我已經使用了[git-bash](https://openhatch.org/missions/windows-setup/install-git-bash)windows客戶端的指令。如果你只需要在你的windows機器上使用git,而cygwin不起作用,我會建議嘗試。 – 2013-02-14 13:30:20