【问题标题】:"Permission denied (publickey)" only over specific network (SSH key configured)“权限被拒绝(公钥)”仅在特定网络上(已配置 SSH 密钥)
【发布时间】:2019-09-20 22:11:36
【问题描述】:

我无法仅通过特定网络从 github 克隆/拉取/推送:

git@github.com: Permission denied (publickey).

我的 SSH 密钥在我的机器和 Github 上配置得很好;我可以从我家的网络克隆/拉/推。我用连接到同一网络的其他机器进行了测试,它们没有这个问题。

这是ssh -vT git@github.com的输出:

OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /Users/Julien/.ssh/id_rsa type 0
debug1: identity file /Users/Julien/.ssh/id_rsa-cert type -1
debug1: identity file /Users/Julien/.ssh/id_dsa type -1
debug1: identity file /Users/Julien/.ssh/id_dsa-cert type -1
debug1: identity file /Users/Julien/.ssh/id_ecdsa type -1
debug1: identity file /Users/Julien/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/Julien/.ssh/id_ed25519 type -1
debug1: identity file /Users/Julien/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/Julien/.ssh/id_xmss type -1
debug1: identity file /Users/Julien/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version PaloAltoNetworks_0.2
debug1: no match: PaloAltoNetworks_0.2
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: **********
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/Julien/.ssh/known_hosts:3
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: Will attempt key: /Users/Julien/.ssh/id_rsa RSA ********** agent
debug1: Will attempt key: /Users/Julien/.ssh/id_dsa 
debug1: Will attempt key: /Users/Julien/.ssh/id_ecdsa 
debug1: Will attempt key: /Users/Julien/.ssh/id_ed25519 
debug1: Will attempt key: /Users/Julien/.ssh/id_xmss 
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Julien/.ssh/id_rsa RSA ********** agent
debug1: Server accepts key: /Users/Julien/.ssh/id_rsa RSA ********** agent
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/Julien/.ssh/id_dsa
debug1: Trying private key: /Users/Julien/.ssh/id_ecdsa
debug1: Trying private key: /Users/Julien/.ssh/id_ed25519
debug1: Trying private key: /Users/Julien/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

有什么想法吗?

感谢您的帮助:)

【问题讨论】:

  • 没有问题是个愚蠢的问题,过于急于拒绝一个问题可能不是对待新手最健康的态度。

标签: git github ssh rsa


【解决方案1】:

网络配置错误或有过滤代理。您指定的输出中的远程软件版本是“PaloAltoNetworks_0.2”,它是一个过滤设备提供商。 GitHub 的远程软件版本应始终包含“babeld”。

您应该联系网络管理员并要求他们删除此过滤。

【讨论】:

  • 是的,在询问网络管理员后,他确认有一些过滤导致了这种情况。
猜你喜欢
  • 1970-01-01
  • 2019-11-24
  • 2014-11-08
  • 2019-03-11
  • 1970-01-01
  • 2018-04-12
  • 2013-07-23
  • 2016-10-15
  • 2020-02-11
相关资源
最近更新 更多