Skip to content

Github Desktop does not provide a UI to accept the public key of a new remote host #3457

Closed

Description

@nanomebia

Description

When using the Github Desktop (Windows) client, there is no UI method provided to accept the public key of a new remote host (when interacting via SSH)

Version

GitHub Desktop version: 1.0.9

OS version: Windows 10

Example strings

HTTPS string: https://github.com/desktop/desktop.git
SSH string: [email protected]:desktop/desktop.git

Notes

I've chosen to use Github.com as the example here, but the below applies to any host you try interact with (eg, a private gitlab instance) via the desktop client

Steps to Reproduce

0. Make a copy of your ~/.ssh/known_hosts file and delete it prior to testing the below issue

  1. Install Github Desktop client
  2. Configure Github.com to accept your SSH public key (After following the SSH keygen process, or using a pregenerated key)
  3. Add (clone) a repository using the SSH method instead of the HTTPS method (notes below regarding this, and see next step to deal with this behavior)
  4. Reconfigure the repository through the UI via Repository>Repository settings to use the ssh remote origin (Potentially unexpected behavior: Even when using the SSH string method the github desktop client will swap to using the HTTPS string, so you need to change it so it actually uses the SSH string)
  5. Once you've confirmed the repository settings are using the SSH string (i.e. [email protected]:desktop/desktop.git) try and fetch origin (it will fail)

Steps to "fix"

  1. use a git shell to git pull on a repository, this will trigger the normal prompt:
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
  1. This adds an entry to ~/.ssh/known_hosts and future interaction with that host will be OK.

Expected behavior: The UI should prompt to approve/deny the new remote SSH server key

Actual behavior: An Authentication error is spawned, with no actions available (or debugging information)

Reproduces how often: 100%

Additional Information

Whilst the github desktop client changes the repository settings (at least, for github.com repositories) to use HTTPS, if a user has specified the SSH string, the client should not automatically change this to be the HTTPS string (seems like unexpected behavior / a feature that could be misleading to the user)

For external / private repositories not hosted on github.com, the client doesn't seem to try change these to HTTPS strings.

Activity

  1. niik commented on Nov 30, 2017

    @niik
    Member

    Hey @nanomebia, thanks for reaching out! Our SSH support definitely needs some work and we're tracking what needs to be done over in #2579. I'll add a link to this issue in there. I'm glad you found a workaround and thankful that you took the time to write up such a detailed issue about it. Out of curiosity, is there something that stops you from consuming Git repositories over HTTP?

    I'll close this issue out and ask that you follow along in #2579 instead.

  2. nanomebia commented on Nov 30, 2017

    @nanomebia
    Author

    Hi @niik

    For me, no there is not, however the behavior seems to be misleading for the user. If a user has taken the deliberate step to use the SSH method over the HTTPS method, it seems likely they would want to consume the repositories over SSH. This did catch me out, as I wasn't expecting the client to change to the HTTPS method when i'd explicitly added the repositories via SSH (as I consume other git repositories via SSH and wanted constancy, additionally ensuring i'm authenticating using my private keys specifically setup for Github).

    There may also be situations (on corporate networks) where a user does not have the ability to consume github.com via HTTPS (unlikely if they are doing any sort of in house development, but not completely impossible) and they may need to consume repositories via SSH. In this instance it's likely the user is already aware of this behavior and would change it accordingly.

    Thanks for linking me - I'd be happy to provide additional information as required over in #2579

  3. ArsalanSaleem94 commented on Jun 4, 2018

    @ArsalanSaleem94

    Same issue when trying to link github desktop with enterprise gitlab, I have ssh key, but desktop client is not prompting for passphrase etc.
    I was only able to fetch/pull via git shell.

  4. robbie-thompson commented on Jun 14, 2018

    @robbie-thompson

    Same here, other non-github remotes may only accept connections via SSH, so being able to provide a passphrase for the private key is essential. For now we're using git shell, but a UI prompt for a passphrase would be ideal!

  5. locked as resolved and limited conversation to collaborators on Aug 13, 2018
  6. unlocked this conversation on Sep 27, 2018
  7. Jing-kfh commented on Jan 14, 2019

    @Jing-kfh

    Same problem here.

  8. jonasbaumann commented on Aug 13, 2019

    @jonasbaumann

    Same problem here

  9. alexandrubau commented on Sep 18, 2019

    @alexandrubau

    Same problem here

  10. vladbndko commented on Feb 15, 2020

    @vladbndko

    Same problem here

  11. lameirat commented on Feb 17, 2020

    @lameirat

    same problem here

  12. caiocesarbrito commented on Feb 27, 2020

    @caiocesarbrito

    This issue was reported in 29 Nov 2017, and until now it remains. It's absurd. Thanks @nanomebia for share a workaround to solve this problem, your solution works for me.

  13. Mishzs commented on Feb 27, 2020

    @Mishzs
  14. anksos commented on Mar 7, 2020

    @anksos

    Any update on that issue? Seems still to be there, no prompting on passphrase using ssh! any update on that @niik ? Or is there any workaround that could work? Macbook 16'' Catalina 10.15.3

  15. marianpg commented on Mar 15, 2020

    @marianpg

    and again, same problem here.
    what is going on? it's getting ridiculous...

  16. d2phap commented on Apr 7, 2020

    @d2phap

    any update, pls

  17. agrmohit commented on Apr 23, 2020

    @agrmohit

    I found that it works when you remove your ssh key passphrase and add it to the ssh-agent. But leaving a key with no passphrase does not seem like a good idea

  18. Yajinyaya commented on May 3, 2020

    @Yajinyaya

    It works for me when I remove my ssh key passphrase.

  19. ewitz commented on Oct 10, 2020

    @ewitz

    Removing the passphrase is not a solution to this SSH issue, I consider @Yajinyaya and @agrmohit 'solution' as a "work-around". Security needs to be bumped up on the list of priorities IMHO...

  20. self-assigned this
    on Aug 10, 2021
  21. sergiou87 commented on Aug 11, 2021

    @sergiou87
    Member

    #12756 should be helpful for this 😄 It will auto-accept github.com, though.

  22. billygriffin commented on Aug 26, 2021

    @billygriffin
    Contributor

    Hi folks, we released this earlier this week, so it should work as expected now. Thank you for your patience and for reporting it!

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

Metadata

Metadata

Assignees

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