Skip to content

GitHub desktop should be able to prompt for SSH key passphrase #8761

Closed

Description

@anqinxu

When we followed the instructions for setting up SSH keys, that involves making a passphrase. Then when we started using Github desktop, it will not clone or pull the repos. It gives error message about authentication failure. It suggested logging in again and that didn't help. It seems like the desktop app does not prompt for SSH key passphrase when it should.

Then we created a new SSH key without passphrase and the problem was solved.

We know that there could be some Windows ssh-agent workarounds that we could be missing but it would be cool if the app just prompts for passphrase and do the right thing. 😄

Activity

  1. kevincantu commented on Dec 7, 2019

    @kevincantu

    A screenshot of the error when trying to fetch:

    • with a repo using an SSH URL
    • when you have a non-empty SSH passphrase:
      githubdesktop-not-finding-ssh-agent

    One ssh-agent workaround we found requires:

    • configuring your .bashrc to always restart the ssh-agent (like so),
    • starting Git Bash, and
    • launching GitHub Desktop from within Git Bash.
      And never ever starting GitHub Desktop from the desktop icon, etc! 🙀

    It'd be nice if it just prompted, like @anqinxu suggests. 😺

  2. steveward commented on Dec 9, 2019

    @steveward
    Contributor

    Thanks for contributing @anqinxu. We have a collection of known SSH limitations catalogued in #2579 (including the SSH passphrase issue), so I'm going to close this issue out in favor of that one and add your feedback there.

    @kevincantu thanks for sharing how you were able to get things working -- that's helpful!

  3. kevincantu commented on Dec 9, 2019

    @kevincantu

    I think it's more severe than the part you've quoted there, @steveward: the only way to run GitHub Desktop if you're using SSH keys with passphrases is to open Git Bash, set up ssh-agent, and run %appdata%\whatever\whatever\GitHubDesktop.exe.

    Starting it by clicking the icons installed by the installer isn't sufficient, and this is not obvious.

  4. steveward commented on Dec 13, 2019

    @steveward
    Contributor

    @kevincantu it sounds like your ssh-agent-PID isn't getting picked up by GitHub Desktop -- you should be able to just run github from the command line rather than using the %AppData% path to fix this. I'm working on a SSH guide for GitHub Desktop where I'll make a note of this.

  5. Bubbleinpit commented on Jan 4, 2021

    @Bubbleinpit
  6. gpbonillas commented on Mar 12, 2021

    @gpbonillas

    A screenshot of the error when trying to fetch:

    • with a repo using an SSH URL
    • when you have a non-empty SSH passphrase:
      githubdesktop-not-finding-ssh-agent

    One ssh-agent workaround we found requires:

    • configuring your .bashrc to always restart the ssh-agent (like so),
    • starting Git Bash, and
    • launching GitHub Desktop from within Git Bash.
      And never ever starting GitHub Desktop from the desktop icon, etc! 🙀

    It'd be nice if it just prompted, like @anqinxu suggests. 😺

    Thanks! It helped me a lot.

  7. mckoss commented on Apr 19, 2021

    @mckoss

    I have to do a similar thing using GitBash on Windows 10.

    My .gitbashrc is (which must be run via $ source .gitbashrc if not included in shell start):

    SSH_ENV="$HOME/.ssh/environment"
    
    function start_agent {
        echo "Initializing new SSH agent..."
        ssh-agent > "$SSH_ENV"
        chmod 600 "$SSH_ENV"
        . "$SSH_ENV" > /dev/null
        ssh-add $HOME/.ssh/id_rsa
        ssh-add -l
    }
    
    if [ -z "$SSH_AGENT_PID" ]; then
        start_agent
    else
        echo "Agent already running..."
    fi
    

    and then I put this script in my path to run githubdesktop:

    #!/bin/bash
    nohup $HOME/AppData/Local/GitHubDesktop/GitHubDesktop.exe >/dev/null 2>&1 &
    
  8. hardysim commented on Jun 11, 2021

    @hardysim

    This is working fine (#8761 (comment)). But it seems that GitHub Desktop already adds itself as github to the path:

    $ which github
    /c/Users/me/AppData/Local/GitHubDesktop/bin/github
    
  9. flavio-marchi commented on Aug 11, 2021

    @flavio-marchi

    Still having this issue, starting Github Desktop with Git Bash and entering the passphrase with every action made in Github Desktop isnt a solution. Has noone tackled this issue yet?

    Without a detour obviously, I'll propably try the .bashrc "solution" in the meanwhile.

  10. steveward commented on Aug 11, 2021

    @steveward
    Contributor

    @flaviosb this is being addressed in #12756.

  11. flavio-marchi commented on Aug 12, 2021

    @flavio-marchi

    @steveward Looks promising, thanks!

  12. sergiou87 commented on Aug 19, 2021

    @sergiou87
    Member

    Latest beta should include this already 😄

  13. billygriffin commented on Aug 26, 2021

    @billygriffin
    Contributor

    We released this to production this week, so please let us know how it's working!

  14. ActionKeith commented on Sep 6, 2021

    @ActionKeith

    Hi @billygriffin -- Eagerly awaiting.
    Any high level guidance on how much time delay to expect for MacOS?

  15. sergiou87 commented on Sep 7, 2021

    @sergiou87
    Member

    @keithhelfrich version 2.9.3 already has support for this on macOS. Is it not working for you? 😳

  16. laukstein commented on Jan 3, 2022

    @laukstein
  17. sergiou87 commented on Jan 4, 2022

    @sergiou87
    Member

    @keithhelfrich version 2.9.3 already has support for this on macOS. Is it not working for you? 😳

  18. nochet2211 commented on May 31, 2022

    @nochet2211

    Version 3.0.0 ....MacOs Monterey..No prompts for me :(

  19. ByteToHex commented on Feb 6, 2025

    @ByteToHex

    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.

  20. josephtarbit commented on Jan 23, 2026

    @josephtarbit

    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.

    Still getting this issue too

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions