OpenSSH升级到7.0+遇到的问题

来源:互联网 发布:galgame制作软件 编辑:程序博客网 时间:2024/05/17 16:00

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”

0 0
原创粉丝点击