Fedora 33:git@bitbucket.org:权限被拒绝(公钥)

Fedora 33: git@bitbucket.org: Permission denied (publickey)

我正在尝试按照 this 官方教程为我的 bitbucket 设置 ssh,但是在排除连接故障的最后一步我得到了以下

git@bitbucket.org: Permission denied (publickey).

这里是 ssh -Tv git@bitbucket.org

的输出
OpenSSH_8.4p1, OpenSSL 1.1.1i FIPS  8 Dec 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: Connecting to bitbucket.org [2406:da00:ff00::22c5:2ef4] port 22.
debug1: Connection established.
debug1: identity file /home/myuser/.ssh/id_rsa type 0
debug1: identity file /home/myuser/.ssh/id_rsa-cert type -1
debug1: identity file /home/myuser/.ssh/id_dsa type -1
debug1: identity file /home/myuser/.ssh/id_dsa-cert type -1
debug1: identity file /home/myuser/.ssh/id_ecdsa type -1
debug1: identity file /home/myuser/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/myuser/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/myuser/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/myuser/.ssh/id_ed25519 type -1
debug1: identity file /home/myuser/.ssh/id_ed25519-cert type -1
debug1: identity file /home/myuser/.ssh/id_ed25519_sk type -1
debug1: identity file /home/myuser/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/myuser/.ssh/id_xmss type -1
debug1: identity file /home/myuser/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4
debug1: Remote protocol version 2.0, remote software version conker_c123b90d72-dirty conker-3003
debug1: no match: conker_c123b90d72-dirty conker-3003
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:<random symbols>
The authenticity of host 'bitbucket.org (2406:da00:ff00::22c5:2ef4)' can't be established.
RSA key fingerprint is SHA256:<random symbols>.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'bitbucket.org,2406:da00:ff00::22c5:2ef4' (RSA) to the list of known hosts.
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: /home/jiraichi/.ssh/id_rsa RSA SHA256:<random symbols> agent
debug1: Will attempt key: /home/myuser/.ssh/id_dsa
debug1: Will attempt key: /home/myuser/.ssh/id_ecdsa
debug1: Will attempt key: /home/myuser/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/myuser/.ssh/id_ed25519
debug1: Will attempt key: /home/myuser/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/myuser/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/jiraichi/.ssh/id_rsa RSA SHA256:<random symbols> agent
debug1: send_pubkey_test: no mutual signature algorithm
debug1: Trying private key: /home/myuser/.ssh/id_dsa
debug1: Trying private key: /home/myuser/.ssh/id_ecdsa
debug1: Trying private key: /home/myuser/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/myuser/.ssh/id_ed25519
debug1: Trying private key: /home/myuser/.ssh/id_ed25519_sk
debug1: Trying private key: /home/myuser/.ssh/id_xmss
debug1: No more authentication methods to try.
git@bitbucket.org: Permission denied (publickey).

真的卡在这里了,感谢任何帮助

您的输入有误。删除“-T”旁边的 'v'。应该是这样的:

ssh -T git@bitbucket.org

显然将这一行 PubkeyAcceptedKeyTypes +ssh-rsa 插入我的 /etc/ssh/ssh_config 解决了问题,我是 运行 Fedora 33

但是我仍然不确定这个解决方案是否会带来任何安全风险。

编辑:找到了更好(我会说更干净)的解决方案 ,显然这是 Fedora 33 的一个已知错误,目前应该使用解决方法。

更新:正如评论中指出的,正确的解决方案是使用 ssh-keygen -t ed25519 并将 public 密钥复制到您的 bitbucket 帐户中。