Skip to content

Feature: Implement SSH Authentication Support for Git Integration #17692

Description

@NyanHeart

What feature or improvement do you think would benefit Files?

Currently, the Git integration in Files only supports authentication over the HTTPS protocol, primarily using GitHub Personal Access Tokens (PATs) obtained via an OAuth login flow.

This means that any repository that has been cloned using an SSH URL (e.g., git@github.com:user/repo.git) cannot perform authenticated network operations like pull, push, or fetch. These operations fail because the application is unable to provide the SSH key credentials required by the Git remote.

This is a significant limitation for developers who prefer using SSH for its security and convenience, effectively preventing them from using the integrated Git features for their existing projects.

Requirements

I propose to implement full authentication support for the SSH protocol. This would involve the following key changes, primarily within the GitHelpers.cs file:

  1. Enhance the CredentialsProvider: The existing CredentialsProvider callback will be updated to intelligently handle different credential requests from LibGit2Sharp.
  2. Detect SSH Requests: The handler will now check if the required credential type is SupportedCredentialTypes.SshKey.
  3. Provide SSH Key Credentials: When an SSH key is requested, the handler will locate the user's default SSH private key (e.g., ~/.ssh/id_rsa).
  4. Support for Passphrases: If the private key is encrypted with a passphrase, a ContentDialog will be displayed, securely prompting the user to enter it.
  5. Complete Authentication: The key path and the (optional) passphrase will be used to create and return an SshUserKeyCredentials object, allowing the SSH authentication to succeed.

This solution would seamlessly enable SSH support while retaining the existing functionality for HTTPS authentication.

Files Version

4.0.11.0

Windows Version

10.0.26100.6584

Comments

Adding SSH support would significantly enhance the Git functionality in Files.

I have already spent time investigating the codebase and have a clear implementation plan. I am willing to contribute the code for this feature and submit a Pull Request.

Before I begin development, I wanted to open this issue to discuss the plan with the project maintainers. I would greatly appreciate any feedback or guidance on this approach.

Thank you in advance!

Activity

  1. yair100 commented on Sep 28, 2025

    @yair100
    Member

    @NyanHeart thanks for reaching out! This proposal looks great to me. I'll wait a couple of days to see if @heftymouse or @ferrariofilippo have any suggestions, but otherwise, we can proceed.

  2. added
    area - git
    on Sep 28, 2025
  3. moved this from 🆕 New to 📋 Planning stage in Files task boardon Sep 28, 2025
  4. ferrariofilippo commented on Sep 29, 2025

    @ferrariofilippo
    Contributor

    Sounds good to me!
    Only thing I can think of is: if you're adding any url validation, don't make it too tight so that you can support even #14453

    BTW if you need any help, feel free to reach out ;)

  5. NyanHeart commented on Oct 18, 2025

    @NyanHeart
    Author

    Hi @yaira2 @ferrariofilippo

    Here's a update. I've got the basic SSH connection working. LibGit2Sharp's SSH functionality is provided through the system's OpenSSH. This works well for keys without a passphrase, as it automatically finds and uses the keys located in the user's ~/.ssh directory.

    The main challenge I've run into is handling private keys that are protected by a passphrase.

    In my testing with a console app, OpenSSH correctly falls back to a terminal prompt, allowing me to enter the passphrase, and the fetch operation succeeds. However, this kind of interactive terminal prompt is obviously not a suitable user experience for a GUI application like Files. We can't have a console window suddenly appearing to ask for a password.

    I'm currently stuck on finding a good way to programmatically handle this passphrase prompt so that we could display a proper dialog within the Files UI instead.

    Just wanted to share where things stand and open the floor for any ideas or suggestions you might have on how to tackle this.

  6. yair100 commented on Nov 9, 2025

    @yair100
    Member

    @NyanHeart thank you for the update.

  7. moved this from 📋 Planning stage to 🏗 In progress in Files task boardon Jan 14, 2026
  8. moved this from 🏗 In progress to 🔖 Ready to build in Files task boardon May 27, 2026
  9. tynorton commented on Oct 29, 2026

    @tynorton

    Running into this currently.

    Could we implement it in two phases if we already have passwordless keys working? That first phase would unlock me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area - git

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions