Skip to content

Improve SSH support with passphrase and host prompts - #12756

Merged
sergiou87 merged 15 commits into
developmentfrom
ssh-add-host
Aug 12, 2021
Merged

sergiou87 merged 15 commits into
developmentfrom
ssh-add-host

Conversation

@sergiou87

@sergiou87 sergiou87 commented Aug 11, 2021 •

Copy link
Copy Markdown
Member

Closes #3457
Closes #8761

Description

This PR sits on top of #12734

The changes in this PR leverage the new TCP-based askpass trampoline from #11510, by providing that trampoline as the askpass program for SSH too.

That way, we can intercept when SSH prompts stuff to the user (like the SSH key passphrase or adding a host to the list of known hosts).

So far this is only available on Windows because macOS makes it a bit difficult to provide a custom SSH_ASKPASS program. That'll be tackled in a different PR.

Screenshots

Note: the video is kind of a lie, since github.com is added as a host automatically. Users will be prompted about other hosts, though.

Screen.Recording.2021-08-11.at.14.20.00.mov

Release notes

Notes: [Fixed] Prompt SSH info to Windows users, like the key passphrase or adding a host to the list of known hosts

@sergiou87
sergiou87 marked this pull request as ready for review August 11, 2021 12:22
@sergiou87
sergiou87 requested a review from tidy-dev August 11, 2021 12:22
@sergiou87 sergiou87 changed the title Ssh add host Improve SSH support with passphrase and host prompts Aug 11, 2021

@tidy-dev tidy-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ Tested it out and it works great! On little nit that you can ignore if you like.


/** Should we use SSH askpass? */
export function enableSSHAskPass(): boolean {
return __WIN32__ && enableBetaFeatures()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should the windows check be in the feature-flag? Just figured that once this goes in and someday we remove the feature flag.. will have to move the Windows check to inside the code somewhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm expecting to have something for macOS soon and remove that Win32 check, so it should be ok 🤞

@ByteToHex

Copy link
Copy Markdown

Hi, would just like to chime in- as of 6 Feb 2025, Github Desktop encounters an infinite loop of 'cloning repository' when a SSH key with passphrase is used. Unsure if there are any workarounds- no prompts are appearing on my end.

I am on Windows.

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

Successfully merging this pull request may close these issues.

GitHub desktop should be able to prompt for SSH key passphrase Github Desktop does not provide a UI to accept the public key of a new remote host

3 participants