状態
- github を ssh 経由で使用している。
- IntelliJ IDEA 組み込みの git ui にてリモート関連操作 (push, pull等) を行うと次のようにエラーが出る。
Update Failed
CreateProcessW failed error:193
ssh_askpass: posix_spawnp: Unknown error
git@github.com: Permission denied (publickey).
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
- IntelliJ IDEA 組み込みの git ui にてローカルの範囲の操作 (commit, switch, branch等) はできる。
- ターミナルからのリモート関連操作はできる。
原因
OS の SSH-AGENT に SSH 鍵が登録されていない。
対応
ssh-add
コマンドで鍵を SSH-AGENT に登録しましょう。
PS C:\Users\hoge> ssh-add.exe # 引数なしの場合 .ssh/id_rsa をデフォルトで指してくれるようです。
Enter passphrase for C:\Users\hoge/.ssh/id_rsa:
Identity added: C:\Users\hoge/.ssh/id_rsa (hoge@コンピュータ名)
参考