Skip to content
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

No prompt for SSH passphrase #246

Closed
json2d opened this issue Jan 10, 2020 · 6 comments
Closed

No prompt for SSH passphrase #246

json2d opened this issue Jan 10, 2020 · 6 comments
Assignees

Comments

@json2d
Copy link

json2d commented Jan 10, 2020

When using an SSH key with a passphrase I don't receive a prompt for that passphrase when pushing/pulling, simply a Permission Denied message.

@json2d json2d added the bug Something isn't working label Jan 10, 2020
@mhutchie
Copy link
Owner

Thanks for raising this!

There are numerous places where Git requests a passphrase / username / password from the user, some of which cannot be intercepted as the prompt is not sent over stdout or stderr of the Git process (which is all the extension, and Node.js in general, can monitor), or using an external authentication system. This appears to the case in your situation, as you’ve said the error dialog only contains “Permission Denied”, and not the text prompting the entry of a passphrase (which would occur if it had of been requested on stdout or stderr of the Git command process).

Git Graph does already integrate with askpass authentication, which is used by Git for several username & password prompts, however askpass mustn’t be used in the situation you have.

Can you please confirm whether or not you’re able to use the Visual Studio Code push/pull status bar button? (I think it should also give you the same / similar error message as Git Graph does, as I just don’t think it’s possible to intercept the passphrase request to display a prompt in the UI)

@mhutchie mhutchie added improvement An improvement to existing functionality needs more info More information has been requested and removed bug Something isn't working improvement An improvement to existing functionality needs more info More information has been requested labels Jan 11, 2020
@mhutchie
Copy link
Owner

I managed to produce a situation where the extension displays a "Permission Denied" error message due to an SSH passphrase not being entered (as there is no prompt in the UI). I assume this is the same as what you have, as you haven't provided any further detail / necessary information, or answered my previous question. (Please use the appropriate provided issue template in the future, as I took the time to create it specifically for these situations.)

When I checked the behaviour of Visual Studio Code's "Push/Pull" / "Synchronise Changes" Status Bar button, it displays the same "Permission Denied" error as the extension does. This indicates to me that Microsoft has reached the same conclusion as I did, that it is not possible in your situation to prompt the user for an SSH passphrase (at least from within Node.js). I'll close this issue for now as all indications suggest that it's not fixable within Git Graph.

If the extension was handling your situation any worse than Visual Studio Code itself, I would have immediately addressed it. However from everything I can see, the extension behaves identically to Visual Studio Code as they are both facing the same integration limitations with git.

Note to others reading this in the future: Please let me know if you're aware of a method to intercept such passphrase prompts, as it would definitely be best to make passphrase prompts visible to the user through the UI.

@json2d
Copy link
Author

json2d commented Jan 18, 2020

I believe you're right and the issue I was facing is the same when using the VSCode push/pull button. Thanks for looking into it.

@eltoroit
Copy link

I am using Git Graph on Windows with a remote repository (Raspberry PI) and it does ask for Github username/password. My issue is that it doesn't remember them and I have to keep typing the same credentials over and over again.

I have decided to push a commit, I am just using VS Code default push which does not ask for the password every time. It does remember the credentials.

My question... is there a way to get Git Graph to match VS Code and remember the credentials?

@liquidcms
Copy link

So the answer is that VSC can't provide a passphrase? That seems very odd. :(

@adelstiti
Copy link

Just add those keys bellow to your environment:

DISPLAY=needs-to-be-defined
SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass

Source: microsoft/vscode#13680 (comment)_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants