no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

新建文件:mkdir wakav
进入文件:cd wakav
初始化:git init
配置用户名和邮箱:

git config --global user.name "lining"  
git config --global user.email "lining@orgtec.cn"

创建新的KEY:

ssh-keygen -t rsa -C "lining@orgtec.cn"  
Creates a new ssh key using the provided email Generating public/private rsa key pair.  
#此处输入将要保存的路径,默认为当前路径  
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>  
输入回车后提示输入一个类似于密码的自定义的通行证号,如果直接回车则为空  
Enter passphrase (empty for no passphrase):<enter a passphrase>  
#提示重新输入以便确认输入是否正确  
Enter same passphrase again:<enter passphrase again>  

查看新的key:

vi ~/.ssh/id_rsa.pub

将内容添加到服务器上。

从远程服务器克隆项目代码到本地:

[root@localhost wakav]# git clone ssh://lining@IP:8849/wakav
正克隆到 'wakav'...
Unable to negotiate with 114.215.120.180: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

这里提示说key配置的不正确,网上搜了下(参考:https://wiki.archlinux.org/index.php/Secure_Shell),要配置git的config文件。

vi ~/.ssh/config

内容如下:

Host somehost.example.org(这是服务器地址)
    KexAlgorithms +diffie-hellman-group1-sha1

然后就可以克隆成功了!

Author:leedaning
本文地址:http://blog.csdn.net/leedaning/article/details/49887015

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值