LoginSignup
12
9

More than 5 years have passed since last update.

git push や pull をしたときに permission denied (publickey) が出てしまった場合

Last updated at Posted at 2013-08-04

普段は git clonegit push ができていたのだけど
突然 git pushgit pull もできなくなった
github とローカルから使用していた公開鍵を削除して
公開鍵の再作成 再登録して

ssh -T gist@github.com

が成功していたけど同様のエラーがでました

その後 ~/.ssh/ に config をつくって

Host github.com
User git
Port 22
Hostname github.com
port 22
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
Host gist.github.com
User git
Port 22
Hostname gist.github.com
port 22
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes

って書いたら出来た
もしかしたら config の作成だけで済んだかもしれない

12
9
3

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
12
9