我在我的Ubuntu PC上安装了我的Git / Gerrit,以下工作正常 . 但是,我试图在我的Windows PC上做同样的事情,但它无法克隆存储库说 - "Unable to negotiate with 55.115.127.145 port 9418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 fatal: Could not read from remote repository."
在〜/ .ssh / config下面添加:也不起作用!
Host your_email@lab126.com
KexAlgorithms +diffie-hellman-group1-sha1
IdentityFile ~/.ssh/id_rsa
Host 55.115.127.145
HostName 55.115.127.145
User <myname>
Port 9418
KexAlgorithms +diffie-hellman-group1-sha1
IdentityFile ~/.ssh/id_rsa
Below are the detailed steps I followed:
1)从http://git-scm.com/downloads下载并安装Git
2) Setup Your Git Username and Email
git config --global user.name "FirstName LastName"
git config --global user.email "your_email@lab126.com"
3) Set up RSA key ssh-keygen -t rsa -C“your_email@lab126.com生成公钥/私钥rsa密钥对 . 输入保存密钥的文件 (/Users/username/.ssh/id_rsa): 输入密码短语(没有密码短语为空):
4)公共私钥保存在 (/Users/username/.ssh/id_rsa) 和(/Users/username/.ssh/id_rsa.pub)文件中
5) Set Up Gerrit : 登录https://e-gerrit.lab.net/
6)在Gerrit中,选择设置 - > SSH公钥 - >添加密钥 - >复制并粘贴公钥
7)打开cmd行并克隆存储库
C:\Git>git clone ssh://e-gerrit.lab.net:9418/framework -b test
8)如上所述在〜/ .ssh /中添加配置文件