在使用GitHub的时候,为了避免每次输入用户名密码,都会使用SSH方式代替Https。

按网上教程,大多数使用SSH-KeyGen生成公私钥对,而后上传公钥至Github,并切换Repositorie为SSH.

Visual Studio Code 使用 Git插件报错 - Permission denied (publickey)

使用SSH-KeyGen输出如下:

Generating public/private rsa key pair. 
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory ‘/root/.ssh’. 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa. 
Your public key has been saved in /root/.ssh/id_rsa.pub. 

注意点在红色部分,如果使用了passphrase,在VSCode中提交或获取代码会报错 - Permission denied (publickey)

解决办法: 不使用passphrase,重新生成秘钥对。

 

具体情况请看: https://github.com/Microsoft/vscode/issues/6202

 

相关文章:

  • 2021-08-28
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案