VScode on OSX - GIT ssh key passphrase - working from build in terminal put not from command palette
Asked Answered
A

3

1

I can connect to the Git server and do anything I want from the VSCode build in terminal, but, as soon as I use the command pallette and want to perform a push, it fails as now passphrase prompt is shown.

Is there any way to avoid entering the passphrase at each push?

Autotomy answered 15/1, 2021 at 11:41 Comment(0)
M
3

That seems expected considering the Remote Development Tips and Tricks section:

Enabling alternate SSH authentication methods#

If you are connecting to an SSH remote host and are either:

  • Connecting with two-factor authentication
  • Using password authentication
  • Using an SSH key with a passphrase when the SSH Agent is not running or accessible

then VS Code should automatically prompt you to enter needed information. I

So make sure the SSH agent is running locally

VS Code will automatically add your key to the agent so you don't have to enter your passphrase every time you open a remote VS Code window.

To verify that the agent is running and is reachable from VS Code's environment, run ssh-add -l in the terminal of a local VS Code window.
You should see a listing of the keys in the agent (or a message that it has no keys).
If the agent is not running, follow these instructions to start it. After starting the agent, be sure to restart VS Code.

Mcdavid answered 16/1, 2021 at 12:23 Comment(0)
B
1

Automatically load keys into the ssh-agent and store passphrases in the keychain: (see step 2)

If you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

First, check to see if your ~/.ssh/config file exists in the default location.

$ open ~/.ssh/config
> The file /Users/YOU/.ssh/config does not exist.

If the file doesn't exist, create the file.

$ touch ~/.ssh/config

Open your ~/.ssh/config file, then modify the file to contain the following lines. If your SSH key file has a different name or path than the example code, modify the filename or path to match your current setup.

Host *.github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519
Boll answered 14/12, 2022 at 22:28 Comment(0)
A
-1

to make it work I had to ad the key to OSX keychain and configure it in .ssh/config

Autotomy answered 16/1, 2021 at 20:30 Comment(1)
How? Where? This is not an anwser.Jansson

© 2022 - 2024 — McMap. All rights reserved.