如何修复 Windows10 Git Bash 上权限被拒绝的公钥?

如何修复 Windows10 Git Bash 上权限被拒绝的公钥?

我无法通过 ssh 连接到运行我朋友的机器人的机器。他添加了我的公共 ssh 密钥,所以我可以加入,但我收到了权限被拒绝的私钥错误消息。 我删除了实际的 IP

$ ssh -vT [email protected]
OpenSSH_8.9p1, OpenSSL 1.1.1n  15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/timm2/.ssh/id_rsa type -1
debug1: identity file /c/Users/timm2/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/timm2/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/timm2/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_ed25519 type 3
debug1: identity file /c/Users/timm2/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/timm2/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_xmss type -1
debug1: identity file /c/Users/timm2/.ssh/id_xmss-cert type -1
debug1: identity file /c/Users/timm2/.ssh/id_dsa type -1
debug1: identity file /c/Users/timm2/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
debug1: compat_banner: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to xxx.xxx.xxx.xxx:22 as 'root'
debug1: load_hostkeys: fopen /c/Users/timm2/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:BfcBpJfQqEgv4TGlGC6lfm+WuBuuei9OuovCVXfncM0
debug1: load_hostkeys: fopen /c/Users/timm2/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the ED25519 host key.
debug1: Found key in /c/Users/timm2/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/timm2/.ssh/id_rsa
debug1: Will attempt key: /c/Users/timm2/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/timm2/.ssh/id_ecdsa_sk
debug1: Will attempt key: /c/Users/timm2/.ssh/id_ed25519 ED25519 SHA256:UIn33GRpXKKtWObWWC2u7h2K2OaevlNVeI6MsZZ0oTs
debug1: Will attempt key: /c/Users/timm2/.ssh/id_ed25519_sk
debug1: Will attempt key: /c/Users/timm2/.ssh/id_xmss
debug1: Will attempt key: /c/Users/timm2/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/timm2/.ssh/id_rsa
debug1: Trying private key: /c/Users/timm2/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/timm2/.ssh/id_ecdsa_sk
debug1: Offering public key: /c/Users/timm2/.ssh/id_ed25519 ED25519 SHA256:UIn33GRpXKKtWObWWC2u7h2K2OaevlNVeI6MsZZ0oTs
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/timm2/.ssh/id_ed25519_sk
debug1: Trying private key: /c/Users/timm2/.ssh/id_xmss
debug1: Trying private key: /c/Users/timm2/.ssh/id_dsa
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).

这是我的文件结构的样子。我将 ssh 添加到我的 github。我按照这个指导创建密钥。

相关内容