问题描述
我今天在Windows 7 64位计算机上安装了Git。我使用git bash来设置公钥等,并将这些信息复制到我的账户中,如。
现在我想在我的Windows机器的cmd内使用git而不是git bash。如果我现在键入 ssh -vT [email protected]
,我会得到以下结果:
$ b CMD:
OpenSSH_4.6p1,OpenSSL 0.9.8e 2007年2月23日
debug1:连接到github.com [207.97.227.239]端口22.
debug1:建立连接。
debug1:身份文件/.ssh/identity类型-1
debug1:身份文件/.ssh/id_rsa类型-1
debug1:身份文件/.ssh/id_dsa类型-1
$ / code>
GIT Bash:
OpenSSH_4.6p1,OpenSSL 0.9.8e 2007年2月23日
debug1:连接到github.com [207.97.227.239]端口22.
debug1:建立连接。
debug1:身份文件/c/Users/Mark/.ssh/identity类型-1
debug1:身份文件/c/Users/Mark/.ssh/id_rsa类型1
debug1:身份文件/c/Users/Mark/.ssh/id_dsa类型-1
在cmd git正在中止与错误消息:权限被拒绝(公钥)。只是为了让你知道我已经将公钥复制到github。
在git bash中它的工作。
奇怪的是在我的笔记本电脑Windows 7上,但32位工作。有关此问题的任何线索?
解决方案
从cmd运行以下命令并再次尝试ssh:
set HOME = c:\Users\Mark
I setup today Git on my Windows 7 64bit Machine. I used the git bash for setting up the public key etc. and copied the information also to my account as proposed in Github help.
Now I want to use git within the cmd of my windows machine instead of the git bash. If I now type
ssh -vT [email protected]
I get the following results:
CMD:
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1
...
GIT Bash:
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Mark/.ssh/identity type -1
debug1: identity file /c/Users/Mark/.ssh/id_rsa type 1
debug1: identity file /c/Users/Mark/.ssh/id_dsa type -1
On the cmd git is aborting with the error message: Permission denied (publickey). Just to let you know I already copied the public key to github.In the git bash its working.
The strange thing is on my notebook Windows 7 but 32 bit its working. Any clue about this issue?
解决方案
Run the following from cmd and try the ssh again:
set HOME=c:\Users\Mark
这篇关于Git公钥访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!