前提・実現したいこと
bitbucketへのpushができなくなったことについて。
railsチュートリアルを進めていたのですが、あるタイミングからgitpushを行うとPermission denied (publickey).とでてきてpushができなくなりました。自分で考えられる原因としてはおそらくssh-keygenを実行してしまったことで今までのkeyが上書きされてしまったのだと思います。ただ解決策がわからず手詰り状態です。どなたかお助けいただけると幸いです。
発生している問題・エラーメッセージ
bitbucketへのpushができなくなった
ec2-user:~/environment/challenging_app (master) $ git push --set-upstream origin master Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
試したこと
SSHの鍵を作成し直し、登録し直すことを試みたのですが上手く登録し直すことができませんでした。
以下の手順で試みました。
$ cd ~/.ssh
$ ssh-keygen -t rsa -C address@example.com ←自分のアドレス
$ chmod 600 id_rsa
$ pbcopy < ~/.ssh/id_rsa.pub ←このコマンドが上手くいきません。
(bash: pbcopy: command not foundと表示されます。)
※configの内容 Host bitbucket.org HostName bitbucket.org User git Port 22 IdentityFile ~/.ssh/bitbucket_rsa TCPKeepAlive yes IdentitiesOnly yes
回答2件
あなたの回答
tips
プレビュー