作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我实际上正在为我的工作场所设置 Atlassian Stash。我遇到了这个我无法解决的问题。请注意,这是在 Windows 7 64 位安装上运行。
在设置 SSH key 时,我按照 Stash 指南了解如何创建它们并将它们设置到我的帐户中。尽管如此,这里遇到的问题并不是真正的字面意思,因为它似乎不接受 key 。 (在 Stash 中创建的两个用户都是管理员,并且对所有 repo 具有管理员权限。)
当执行简单的克隆命令时,出现此错误:
$ git clone ssh://git@localhost:7999/test/test.gitCloning into 'test'...Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
我按照 Atlassian 网站上文档区域中的步骤进行操作,但仍然无法正常工作。
Git Operations Fail - Permission denied - publickey
$ ssh -p 7999 -I ~/.ssh/id_rsa -vT git@localhostOpenSSH_6.6.1, OpenSSL 1.0.1m 19 Mar 2015debug1: Connecting to localhost [127.0.0.1] port 7999.debug1: Connection established.dlopen /c/Users/Webit-Alex/.ssh/id_rsa failed: dlopen: Win32 error 126debug1: identity file /c/Users/Webit-Alex/.ssh/id_rsa type 1debug1: identity file /c/Users/Webit-Alex/.ssh/id_rsa-cert type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_dsa type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_dsa-cert type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_ecdsa type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_ecdsa-cert type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_ed25519 type -1debug1: identity file /c/Users/Webit-Alex/.ssh/id_ed25519-cert type -1debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_6.6.1debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.14.0debug1: no match: SSHD-CORE-0.14.0debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: sending SSH2_MSG_KEX_ECDH_INITdebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: RSA 0e:58:0e:af:a8:a1:35:5b:5e:3c:ac:8a:50:af:13:a9debug1: Host '[localhost]:7999' is known and matches the RSA host key.debug1: Found key in /c/Users/Webit-Alex/.ssh/known_hosts:1debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering RSA public key: /c/Users/Webit-Alex/.ssh/id_rsadebug1: Authentications that can continue: publickeydebug1: Trying private key: /c/Users/Webit-Alex/.ssh/id_dsadebug1: Trying private key: /c/Users/Webit-Alex/.ssh/id_ecdsadebug1: Trying private key: /c/Users/Webit-Alex/.ssh/id_ed25519debug1: No more authentication methods to try.Permission denied (publickey).
是否有人有解决方案或愿意帮助 Stash 正常工作?
最佳答案
我遇到了同样的问题,但试图访问远程主机而不是本地主机。奇怪的是它在前一天晚上工作得很好。我得到了与原始海报完全相同的错误。最后,我删除了存储服务器上的所有 SSH key ,并重新添加了之前的 id_rsa.pub key 。我又试了一次,效果很好。我的 SSH key 在存储服务器上损坏或存储服务器无法加载我的 key - 无论哪种方式重新添加它都解决了问题。
关于git - Atlassian Stash - 权限被拒绝(公钥),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30769119/
我是一名优秀的程序员,十分优秀!