
私は Windows 10 を使用していますが、なぜ Bitbucket からリポジトリをクローンできないのか本当に困惑しています。キーペアを生成し、公開キーを Bitbucket アカウントに追加し、秘密キーを ssh-agent に追加しました。ssh-add -l
表示される内容は C:\Users\"username"\.ssh\id_rsa (RSA) で、これは正しいキーです。今では、SSH を使用して Bitbucket に接続しようとしても、他の多くの行とともに次の行が返されます。ssh -vT [email protected]
debug1: identity file C:\\Users\\<username>/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in C:\\Users\\<username>/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:9CVIiWqSy1eKuUS7yhmwum6VgKrW/tJE0/T2PWdAWmQ C:\\Users\\<username>/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
**debug1: Authentication succeeded (publickey).**
Authenticated to bitbucket.org ([18.205.93.2]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
logged in as <user>
You can use git or hg to connect to Bitbucket. Shell access is disabled
しかし、リポジトリをクローンしようとすると、次git clone <repo_url copy pasted from bitbucket directly>
のようになります:
Cloning into '<repo_name>'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
リポジトリの設定を見ると、書き込み権限はあります。何が間違っているのか、まったくわかりません... 何かアイデアはありますか? Https は機能するので、権限の問題ではないはずです。ただし、ssh を使用したいと思います。奇妙なのは、key_load_public は、キーが存在するにもかかわらず、キーを見つけられないのに、その後、何らかの理由で認証が成功することです。
答え1
クローンしようとしているリポジトリ固有の設定で利用可能なアクセス キーを追加した可能性があります。それらはリポジトリへの読み取り専用アクセスを提供します。下の画像を参照してください。
Bitbucket アカウント設定に SSH キーが追加されていることを確認し、再度確認してください。