LoginSignup
1
0

More than 1 year has passed since last update.

WSL2(Ubuntu)+VSCodeでGitHubにpushしようとすると、「Permission denied (publickey)」が出る

Posted at

環境

  • Windows10
  • Ubuntu20.04.2 (WSL2)
  • git ver2.25.1

前提

  • コマンドではエラーはでない
  • VSCodeのGUIで操作するとエラーが出る
  • SSHの設定はUbuntuの方(/home/[user名]/.ssh)ではしている

原因

(たぶん) Windowsの方でSSHの設定していない

解決方法

WindowsのC:\\ユーザー\[ユーザー名]\.sshの方でもSSHの設定をする。

※ubuntuの場合は、cd /mnt/c/users/[ユーザー名]/.sshで該当場所に移動できる。

SSHの設定方法はこちらの記事を参考に
https://qiita.com/shizuma/items/2b2f873a0034839e47ce

まとめ

UbuntuのファイルをGitHubで管理しようとしていたので、Ubuntuの方だけSSHの設定をしていたが、VSCodeのGUIで使う場合は、Windowsの方にもSSHの設定をしないといけない。

1
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
1
0