-
Notifications
You must be signed in to change notification settings - Fork 28.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git: Support git with private key password #13680
Comments
Does it work from the command line? How exactly do you setup git to use the private key file? |
It works from the command line. Actually I setup git via tortoise git - so I guess all is properly done. |
How do you launch the command line? Which command line? |
I use git bash (MINGW64) on windows. |
Right. So, we might have to add a |
With Windows 10, Git 2.10.1. Had problems using git on vscode with my production server, so I created a test server. In production I'm using a passphrase protected key with a different 5 digit port for ssh. |
@joaomoreno Why did you moved it to the backlog? |
Just planning priorities. You can attempt a pull request though. 👍 |
Waiting for it 😉 |
Any update on this? I'm having the same problem and it's pretty annoying 😞 |
@joaomoreno I'm taking a stab at this. It affects me personally now as I recently moved to key based security. People can track my progress here. |
@hashhar That's awesome! 🍻 Let me know if you hit some walls. |
@joaomoreno I was looking into the places that need change and found the following: Current Scenario:
Proposed Changes:
No other changes will be necessary (from what I've currently seen) because the communication with the git endpoint is handled by git.exe not by vscode. |
Okay, my bad about the url parsing. Seems like node accepts urls like What should I do about this, should vscode just magically prepend |
Ping @joaomoreno. If you can find the time, do comment on the above issues I have. I have currently hacked together a proof of concept by starting the ssh-agent against a private key. It works but some polish is still needed. |
@hashhar Sorry for the delay... I'm actually quite busy at the moment. Feel free to create the PR and move the discussion there, we'll try to get it in for March. |
I had to do this to get it to work (done in the remote server terminal): |
Yes, if we add the key to the agent every time we load VS Code, then that works. If done only one-time, then SSH does not retain the SSH credentials after closing that VS Code session.
Right, this is the easiest work-around. It amounts to giving up on SSH compatibility, though. |
Yeah, I guess it is giving up on ssh :( I needed to find something that works so i could be operational again. Unfortunately none of the ssh-agent/ ssh-add solutions worked for me. |
Same for me, I don't want to change to HTTPS or to use SSH/PGP keys without password. So my workaround is using the integrated terminal in vscode to run the commands that require passwords (commit, push) and use the vscode GUI for the rest (stage, diff). |
I think you are right @koepalex, I mostly end up doing most of the git stuff in the integrated terminal too, so i think i'll change back to ssh and just continue without the vscode git tools. |
Is it Linux, Windows, or? Have you tried the "PuTTY Link" or similar "proxyfied" option like the following: #13680 (comment) ? |
I'm not encountering this. It retains my passphrase across multiple vscode launches. On Windows, I open git bash and do ssh-agent and add my key, type my passphrase in, and then i can re-use that over and over and only had to type the passphrase once. |
My repo is on an Ubuntu VM running in Parallels on a Mac. VSCode is running on the Mac, and I'm using a remote connection in VSCode to access everything including the terminal. Its inside this terminal tab in VSCode, after connecting to the linux VM, that I add the ssh key to the ssh-agent. If i run any git command in the terminal tab, then i am not prompted for a password (as expected). If i use the source control stuff in VSCode, then i just get the error "Git: git@github.com: Permission denied (publickey)." It looks like the VSCode environment is not seeing the ssh-agent that i set in the terminal tab. Hope that makes sense. Let me know if anything there seems incorrect. :) |
Pretty much what happens to me on Windows with Git Bash. I add the key to the ssh-agent in bash in Windows Terminal and it works fine for any git commands there, but VSCode is ignorant of it and asks for the ssh-key password every time. |
yo, 6 years later and yet here we are. this should be fixed without ssh-agent. i dont use ssh-agent and i'm happy to input my passphrase everytime (just like i do in the console) |
I genuinely can't believe this hasn't been fixed yet. |
My apologies, but have you considered submitting a pull request with a possible solution, yet? |
Just Microsoft things ... |
easy method onece input user and password, then input: git config --global credencial.helper store then ok! |
I wanted to follow up on this issue and you provide you an update regarding some of the improvements that we have made recently when it comes to better support of SSH keys that use a passphrase. Before using VS Code, please ensure that you are able to successfully use the SSH key that uses a passphrase from your terminal for various git operations (ex: clone, pull, push). You can use the following steps to test you SSH key, and to troubleshoot any potential problems. The latest Insiders release of VS Code contains improvements to detect that the SSH key uses a passphrase and displays a quick input widget at the top of the window so that users can enter the passphrase for the SSH key. The passphrase has to be entered every time the SSH key is used for a git operation. You can also configure the authentication agent on your machine using these steps so that you do not have to enter the passphrase every time the SSH key is used. Please download the latest Insiders release, try out these improvements and let me know if you run into any issues. |
I have file a new issue to track the pending work to support SSH keys with a hardware key. I will go ahead and mark this issue as closed so that it gets covered in the current endgame in preparation for the upcoming Stable release. If you run into any issues please file a separate issue. Thank you! |
@lszomoru Thanks for your work, just keep waiting for this feature until now! |
Thanks so much for this! |
Steps to Reproduce:
Result:
The text was updated successfully, but these errors were encountered: