Git 公钥访问被拒绝

发布于 2024-12-04 04:11:58 字数 1210 浏览 0 评论 0原文

我今天在我的 Windows 7 64 位机器上安装了 Git。我使用 git bash 来设置公钥等,并将信息也复制到我的帐户,如 Github 帮助

现在我想在 Windows 机器的 cmd 中使用 git 而不是 git bash。如果我现在输入 ssh -vT [email protected] 我得到以下结果:

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错误消息:权限被拒绝(公钥)。只是为了让你知道我已经将公钥复制到 github 了。 在 git bash 中它的工作原理。

奇怪的是我的笔记本电脑 Windows 7 但 32 位它可以工作。关于这个问题有什么线索吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄居人 2024-12-11 04:11:58

从 cmd 运行以下命令并再次尝试 ssh:

set HOME=c:\Users\Mark

Run the following from cmd and try the ssh again:

set HOME=c:\Users\Mark
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文