cant ssh into git:通道0上的PTY分配请求失败

mfuanj7w  于 2023-10-14  发布在  Git
关注(0)|答案(2)|浏览(185)

我正在尝试更新homebrew,但我无法连接到git..我看到https没有通过,当我尝试ssh -t时,我得到:PTY分配请求在通道0上失败,以下是我从ssh -v得到的结果:

  1. klein@MacBook-Pro .ssh % ssh -v [email protected]
  2. OpenSSH_8.1p1, LibreSSL 2.7.3
  3. debug1: Reading configuration data /Users/klein/.ssh/config
  4. debug1: /Users/klein/.ssh/config line 1: Applying options for github.com
  5. debug1: Reading configuration data /etc/ssh/ssh_config
  6. debug1: /etc/ssh/ssh_config line 47: Applying options for *
  7. debug1: Connecting to github.com port 22.
  8. debug1: Connection established.
  9. debug1: identity file /users/klein/.ssh/id_rsa type 0
  10. debug1: identity file /users/klein/.ssh/id_rsa-cert type -1
  11. debug1: Local version string SSH-2.0-OpenSSH_8.1
  12. debug1: Remote protocol version 2.0, remote software version babeld-42834f78
  13. debug1: no match: babeld-42834f78
  14. debug1: Authenticating to github.com:22 as 'git'
  15. debug1: SSH2_MSG_KEXINIT sent
  16. debug1: SSH2_MSG_KEXINIT received
  17. debug1: kex: algorithm: curve25519-sha256
  18. debug1: kex: host key algorithm: rsa-sha2-512
  19. debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
  20. debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
  21. debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  22. debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
  23. debug1: Host 'github.com' is known and matches the RSA host key.
  24. debug1: Found key in /Users/klein/.ssh/known_hosts:1
  25. debug1: rekey out after 134217728 blocks
  26. debug1: SSH2_MSG_NEWKEYS sent
  27. debug1: expecting SSH2_MSG_NEWKEYS
  28. debug1: SSH2_MSG_NEWKEYS received
  29. debug1: rekey in after 134217728 blocks
  30. debug1: Will attempt key: RSA SHA256:FtOwFwwlGSFpdkdM+Po6Yv5CUrgfxPND9Aq/b575NdI agent
  31. debug1: Will attempt key: [email protected] RSA SHA256:9hkiUuvWfFm6hbf5l3zsBBIF6MAQkpeAah3ukcq0cOA agent
  32. debug1: Will attempt key: /users/klein/.ssh/id_rsa RSA SHA256:tFpBa6n3n4eB4KtqUFy0dvj3xWnURehYvdB5tr6BbJQ explicit
  33. debug1: SSH2_MSG_EXT_INFO received
  34. debug1: kex_input_ext_info: server-sig-algs=<[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
  35. debug1: SSH2_MSG_SERVICE_ACCEPT received
  36. debug1: Authentications that can continue: publickey
  37. debug1: Next authentication method: publickey
  38. debug1: Offering public key: RSA SHA256:FtOwFwwlGSFpdkdM+Po6Yv5CUrgfxPND9Aq/b575NdI agent
  39. debug1: Authentications that can continue: publickey
  40. debug1: Offering public key: [email protected] RSA SHA256:9hkiUuvWfFm6hbf5l3zsBBIF6MAQkpeAah3ukcq0cOA agent
  41. debug1: Authentications that can continue: publickey
  42. debug1: Offering public key: /users/klein/.ssh/id_rsa RSA SHA256:tFpBa6n3n4eB4KtqUFy0dvj3xWnURehYvdB5tr6BbJQ explicit
  43. debug1: Server accepts key: /users/klein/.ssh/id_rsa RSA SHA256:tFpBa6n3n4eB4KtqUFy0dvj3xWnURehYvdB5tr6BbJQ explicit
  44. Enter passphrase for key '/users/klein/.ssh/id_rsa':
  45. debug1: Authentication succeeded (publickey).
  46. Authenticated to github.com ([140.82.112.4]:22).
  47. debug1: channel 0: new [client-session]
  48. debug1: Entering interactive session.
  49. debug1: pledge: network
  50. debug1: Sending environment.
  51. debug1: Sending env LC_CTYPE = UTF-8
  52. PTY allocation request failed on channel 0
  53. Hi kippelicious! You've successfully authenticated, but GitHub does not provide shell access.
  54. debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
  55. debug1: channel 0: free: client-session, nchannels 1
  56. Connection to github.com closed.
  57. Transferred: sent 4208, received 2672 bytes, in 0.2 seconds
  58. Bytes per second: sent 17817.7, received 11313.9
  59. debug1: Exit status 1

我已经删除了我的整个.ssh文件夹,安装了新的ssh密钥,但没有任何工作。
有人能帮忙吗?

6jygbczu

6jygbczu1#

更好的测试应该是:

  1. ssh -T [email protected]

你只会看到:

  1. Hi kippelicious! You've successfully authenticated, but GitHub does not provide shell access.

这样,您就可以开始使用SSH URL,如[[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) :<me>/<my repo>

i2byvkas

i2byvkas2#

这个错误也发生在我身上,因为小t当我尝试ssh -T [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection)它确实工作

相关问题