Bitbucketにpushしようと、$ git push origin master
を実行すると、
fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
とエラーが出ます。(Permission deniedとは出ません)
ssh鍵の設定はしています。(~/.ssh配下にid_rsa, id_rsa.pub, known_hostsがあります)
もちろんoriginもBitbucketのリモートリポジトリとして設定しています。
タイトルに「何度か」と書いたのは、私が$ ssh -T git@bitbucket.org
で接続を試みると、何度かはメッセージが返ってこず、3,4回したところでやっと、
logged in as <ユーザー名>. You can use git or hg to connect to Bitbucket. Shell access is disabled.
というメッセージが来るわけです。ここで$ git push
すると成功します。
つまり、ssh接続の問題だと思うのですが、ネットで似たような事例を見つけられないので、なぜこのようになるか&解決方法が分かる方ご教授お願いします。
追記:失敗するときのlog(投げやりで申し訳ありません)
OpenSSH_7.6p1, LibreSSL 2.6.2 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to bitbucket.org port 22. debug1: Connection established. debug1: identity file /Users/<ユーザー名>/.ssh/id_rsa type 0 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/<ユーザー名>/.ssh/id_ed25519-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.6 debug1: Remote protocol version 2.0, remote software version conker_1.1.13-7af6557 app-131 debug1: no match: conker_1.1.13-7af6557 app-131 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: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A debug1: Host 'bitbucket.org' is known and matches the RSA host key. debug1: Found key in /Users/<ユーザー名>/.ssh/known_hosts:1 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:<公開鍵> /Users/<ユーザー名>/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 Enter passphrase for key '/Users/<ユーザー名>/.ssh/id_rsa': Connection closed by 2406:da00:ff00::22cd:e0db port 22
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/28 04:12