0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ec2でのpullコマンドのエラー解決について

Posted at

####エラー内容

git pull origin ブランチ名

を実行した際、

Enter passphrase for key '/home/ec2-user/.ssh/id_rsa': 
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

とのエラーが発生する。


####解決法

こちらのサイトを参考にください。
分かりやすく丁寧に解説してくれています。

【git エラー解決策】Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. が出た時の解決方法


####補足

ただ、上記説明記事にて、最後の「ssh -T git@github.com」が

Bad owner or permissions on /home/ec2-user/.ssh/config

とのエラーが発生された方は

chmod 600 ~/.ssh/config

を実行することで、「ssh -T git@github.com」が通るようになります。

ここまでくれば、git pullコマンドにてデータを持って来られるようになります。


####最後に

この記事が、同じエラーと闘う人の助けになりますように。


####参考記事

【git エラー解決策】Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. が出た時の解決方法
SSHコマンド実行時に生じたBad owner or permissions on /home/(user_name)/.ssh/config エラーの対処法

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?