openshift-git-clone-publickey-error

环境: Win7 、Git、SecureCRT
现象:
已经通过SecureCRT生成openssh格式的公钥,同时在openshift配置内增加了public keys.
git clone时报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

阅读了这篇文章后,
renatoargh的回答中得到启发:
You might have to create a config file (yeap, extension-less) under ~/.ssh/config with the following contents

Host bitbucket.org
IdentityFile ~/.ssh/id_rsa_your_bitbucket_private_key
That immediately solved my problem!

解决步骤:
1、ssh -vT myuser@myhost,debug打印出如下信息:
OpenSSH_7.3p1, OpenSSL 1.0.2k 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config

发现读取的ssh配置是Git的,修改了$GIT_HOME/etc/ssh/ssh_config文件
增加了如下内容:
Host myhost
IdentityFile C:/Users/user/.ssh/my_public_key

然后重新执行上面的ssh -vT myuser@myhost
done!

此条目发表在git分类目录,贴了标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注