VS Code Source Control Feature Failing on Remote Authentication

Viewed 116

Problem:
Unable to use the source control feature on VS Code due to authentication problems

Setup:
Editing on a Windows Laptop then remoting into a linux server via VS Code's SSH extension. The Git repo is setup on the linux server. I'm able to push/pull/etc. via the command line to the repo, but the source control feature fails. The following error arises:

Permission denied, please try again.
Permission denied, please try again.
git@[company gitlab domain]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

I've tried to regenerate the SSH keys and that did not solve the problem. The credentials in windows are set correctly as well.

1 Answers

The credentials in windows are set correctly as well.

If by "credentials", you are talking about username/password cached in the git config credential.helper, that would not help SSH at all, since this is only used for HTTPS URLs.

I'm able to push/pull/etc. via the command line to the repo, but the source control feature fails.

double-check the remot eURL on command-line, from the Linux server, in the root folder of that Git repository:

git remote origin

Make sure it is an SSH one

You could replace it by:

gl:<me>/<myrepo>

With gl an entry set in the remote account ~/.ssh/config

Host gl
  Hostname: [company gitlab domain]
  User: git
  IdentityFile: /home/aUser/.ssh/aKey
Related