您的位置:首页 > 运维架构

OpenSSH升级到7.0+遇到的问题

2017-03-13 17:22 477 查看
1、当用git 执行git pull –rebase

遇到:

Unable to negotiate with xx.xx.xx.xx port 29418: 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.

解决:

执行git clone 或者git pull前一步执行:

export GIT_SSH_COMMAND=’ssh -o KexAlgorithms=+diffie-hellman-group1-sha1’

2、git commit 的时候change id丢失(默认已具备gerrit的使用技能)

scp -P29418 xx@xx.xx.xx:hooks/commit-msg .git/hooks

遇到:

Unable to negotiate with xx.xx.xx.xx port 29418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

原因:不能复制commit-msg文件,server端的OpenSSH还是老版本的,client已经用了7.0+了(很有可能已经用了新的2016款Mac,自带的OpenSSH已经是7.0+),当然很多时候我们并不能控制server端的版本。

解决:

(1)在之前的工程.git/hooks/commit-msg复制到新项目中(注意:不是这个文件commit-msg.sample)

(2)执行命令

chmod +x .git/hooks/commit-msg

echo “\nThe commit-msg hook was added to git hooks”
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git gerrit openssh