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 5 years have passed since last update.

git でsshでエラーとなるときにconfigパスの設定方法について

0
Posted at
terminal
ssh -T git@github.com

git@github.com: Permission denied (publickey).

ssh-add していないとのこと。

terminal
ssh -T git@github.com

git@github.com: Permission denied (publickey).

鍵しても、ssh-addを忘れていると上記エラーが出ることがあります。
まずは「ssh-add -l」して状態を確認。
読み込んでほしい秘密鍵のパスがちゃんと出てこればOKです。
出てこなければ、ssh-addする。

eval ssh-agent
ssh-add ~/.ssh/id_rsa

それでもだめなら

terminal
cat config

以下追加

terminal
cat config
Host github
  HostName github.com
  IdentityFile ~/.ssh/id_rsa_github #→ここの宛先を変更する
  User git

以上

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?