2013-02-14 189 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