Repository navigation
Description
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
- Install Github Desktop client
- Configure Github.com to accept your SSH public key (After following the SSH keygen process, or using a pregenerated key)
- 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)
- 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)
- 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"
- 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
- 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
niik commentedon Nov 30, 2017
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.
nanomebia commentedon Nov 30, 2017
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
ArsalanSaleem94 commentedon Jun 4, 2018
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.
robbie-thompson commentedon Jun 14, 2018
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!
Jing-kfh commentedon Jan 14, 2019
Same problem here.
jonasbaumann commentedon Aug 13, 2019
Same problem here
alexandrubau commentedon Sep 18, 2019
Same problem here
vladbndko commentedon Feb 15, 2020
Same problem here
lameirat commentedon Feb 17, 2020
same problem here
caiocesarbrito commentedon Feb 27, 2020
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.
Mishzs commentedon Feb 27, 2020
anksos commentedon Mar 7, 2020
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
marianpg commentedon Mar 15, 2020
and again, same problem here.
what is going on? it's getting ridiculous...
d2phap commentedon Apr 7, 2020
any update, pls
agrmohit commentedon Apr 23, 2020
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
Yajinyaya commentedon May 3, 2020
It works for me when I remove my ssh key passphrase.
ewitz commentedon Oct 10, 2020
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...
sergiou87 commentedon Aug 11, 2021
#12756 should be helpful for this 😄 It will auto-accept github.com, though.
billygriffin commentedon Aug 26, 2021
Hi folks, we released this earlier this week, so it should work as expected now. Thank you for your patience and for reporting it!