Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1864|回复: 0
打印 上一主题 下一主题

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

[复制链接]

697

主题

1142

帖子

4086

积分

认证用户组

Rank: 5Rank: 5

积分
4086
跳转到指定楼层
楼主
发表于 2017-5-23 19:53:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
http://www.ithao123.cn/content-10889965.html

新建文件: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-sha1fatal: 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

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-4-26 07:48 , Processed in 0.058314 second(s), 19 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表