-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot clone repository with SSH private key #218
Comments
How you import the key doesn't matter. We keep the ASCII armored key. It is possible that the key format is not supported by the upstream library that we have been using. May I ask what is your key type? I think one possible workaround is that you generate another pair of keys. We are trying to maintain a list of supported/unsupported keys. You may check https://github.com/mssun/passforios/wiki/Supported-Unsupported-Key-Algorithms to see some keys that are definitely supported. EDIT: It seems like you were able to clone some of you other repositories. Are you using a new ssh key now? |
I'm having this exact same issue with a freshly generated ssh key from iOS 12.0.0 on an iPhone 6S+ here. |
I have the same issue with a new iPhone (IOS 12) #202 prevents me from using https with my gogs git server and now this even prevents me from using ssh. My old iPhone also running IOS 12 works fine, but I cloned with an older version of pass for ios and gogs almost a year ago over https. |
This is because newly generated keys with
While previously the same command generated a file that started with this string:
So, the new format is not supported. |
@maximbaz Thank you. I will put this in Supported Unsupported Key Algorithms. |
@genigenigeni Would you please check whether |
@yishilin14 I just tried generating a key in the old format using |
I wasn't able to convert an existing private key, but here is a way of generating a compliant key pair
|
Resolved. Thank you @hreese I followed your steps exactly and it is working now-successfully cloned into my iphone. Easy peasy lemon squeezy. |
I ran into the same issue and was able resolve it by asking
From OpenSSH v7.8 onwards, |
@brortao - I also couldn't get
@loizoskounios I tried your incantation as well, which judging from a glance is the same as @brortao's recommendation except with a larger I also tried using @hreese's In all of these attempts, I've tried creating SSH keys without passwords. In these cases, Does anyone have any more insight into the underlying issue? Should we use For
|
I've also tried both @hreese (with & without passphrase) and @loizoskounios solutions but no luck. GIT REPOSITORY URL: ssh://git@IP/home/git/.password-store.git SOLVED That, in combination with @hreese puttygen solution worked for me. @wpcarro does your GIT REPOSITORY URL include the .git ending? Make sure it does not. Worked for me when omitting it. I'd happily update the wiki if I had permission to do so :) |
@kraem what are you using for your SSH keys if you aren't using ssh-keygen -t rsa -b 2046 -m PEM Also, are you using a passphrase for the key? I tried omitting
|
Just to cover more variables, I created a key with |
@wpcarro I got it to work using RSA 2048 key with passphrase created with puttygen |
@kraem thanks. Just tested now with a password, and it's still now working. puttygen -t rsa -b 2048 -O private-openssh -o pass_for_ios.key
puttygen pass_for_ios.key -C "Pass for iOS" -O public-openssh -o pass_for_ios.pub ...and I'm getting the same error. I'm using a private repository on GitHub, and I'm transferring the private, public keys with the following: xclip -selection clipboard -i <pass_for_ios.pub # uploaded to GitHub
xclip -selection clipboard -i <pass_for_ios.key # emailed to iPhone Any idea what might be going wrong? |
@wpcarro Only difference I can see is that I used https://github.com/yishilin14/asc-key-to-qr-code-gif/ instead of copy-pasting with xclip. I’ll look closer when not afk :) |
@kraem thanks for sharing. No luck this way either as I expected. What's interesting, however, is that I can't clone the repository locally either, which is validating. UpdateAfter running some local tests to reproduce the issue, I finally got this working. For me, I needed to test the following variables: Variables
Take-awaysThe URL and the Username I entered into Git repository URL and UsernameBadGit repository URL: GoodGit repository URL: In retrospective, it seems as if I should have caught this earlier on in the process. Bear in mind, however, that trying to troubleshoot six variables (listed above) made the troubleshooting quite time-consuming. I also allocated most of my time troubleshooting the SSH key generationBoth of these should work: ssh-keygen -t rsa -b 2046 -m PEM -f ./secret.key puttygen -t rsa -b 2048 -O private-openssh -o pass_for_ios.key && \
puttygen pass_for_ios.key -C "Pass for iOS" -O public-openssh -o pass_for_ios.pub RecommendationsThanks again for making this app. I'm quite happy to finally have it up-and-running. I intend on contributing one of these days. I'm in the middle of a trans-Atlantic relocation. Once that settles, I should have some time to contribute! With that out of the way, here are some humble recommendations.
|
@wpcarro Just added your suggestions to https://github.com/mssun/passforios/wiki/Supported-or-Unsupported-Keys . PRs are always welcomed! The current error messages are far from enough. And after reading all issues, now I feel that they are even a bit "misleading"... |
@wpcarro Interesting.
The only variable I'm changing is .git extension in the git repository url. |
@kraem strange... I cannot speak to non-GitHub domains. It may be possible that GitHub resolves |
Got the same issue. Can't clone Ssh key is openssh rsa -b 4096. |
@infinitylx in your case the colon behind the domain might be the culprit. The Wiki points out that only a slash follows the domain. |
@SimplyDanny Thanks that helped. Now I have some issues with key type... But I think someone talk about it somewhere above... So thx for answer. |
@infinitylx I battled some time with this issue. The normal way I would clone my password-store repository on laptops using a git client would be something along the lines of
which I in passforios would translate to the clone url
But after much trial and error (and unfortunately some less than helpful error messages), I found out that the url needs to be the complete, absolute path to the repository on the target server, such that if the repository is hosted in
All other git clients I have worked with would infer the base path from the login shells notion of I think then that your url @infinitylx should be
|
Confirming once again for all that the problem is the format of the key. The legacy pem public key format works whereas the default format of RFC4716 does not. Use the
|
@wpcarro Regarding the |
We have updated libgit2/libssh2/openssl and shipped a TestFlight 0.8.0 (41) with this update. This update will support ECDSA, ED25519 and more algorithms. Please help me to confirm this problem is fixed. Refer: #305 (comment) |
I used all options and still don't work. I use Debian and Github. On Debian I can clone my repo, but on iOS not. EDIT: |
Same issue here. Cannot clone because it complains about user name mismatch, but of course they match. I followed the URL scheme in the wiki, but it seems not to work with 0.9.0 |
The correct format seems documented here: #336 (comment). Crucially, the username seems to have to come before |
I just had this issue, and I think this is mainly a usability issue, there's simply too many moving parts and it's hard to determine which problem you are having. I ended up figuring out a solution by double checking everything several times. |
Do you think it would help to change the UI in a way that only parts of the URL can be entered? For example:
|
@SimplyDanny: A combobox for selecting ssh/https as protocol might be okay, but splitting the rest of the URL up in individual pieces seems a bit tiresome to type in, especially for those users who knows what he/she is doing. An alternative would be to allow more formats of the URL, e.g. if it was possible to just tell users "copy in the clone URL" of the repo, then most people would be able to figure out that they need to supply something like Another alternative, would be to detect common errors and show some better error messages, that suggests what to try and change (e.g. if the user has typed |
I just revisited this while setting up a new phone. I'm getting errors when cloning an URL which has to do DNS resolving: The DNS record is OK, tried cloing the the repo using the domain name on a laptop and it is working (which is on the same wifi as the phone so it shouldn't be a problem with resolving). EDIT |
I was getting the following error using SSH Key authentication:
Adding the username to the URL fixed the issue for me. ( These were my initial settings which gave the error:
I found it confusing that the username had to be in the URL and username field. If it is not in the URL, I get the If the username is in the URL but not the Username field, I get a different error:
|
This is driving me nuts. I have successfully cloned the repo using the same ssh key on my local machine but the app always shows the same error ending in: The URL is simply Any ideas on how to further diagnose this error? I am using a standard 2048 rsa key, I have also tried the old PEM format, no change to observe. Edit: Only workaround I could find was to add a second origin to my repo and push it to github. Cloning from there works. |
Thank you. This finally solved my problems. I was able to get past the |
I just had the same problem on Pass for iOS 0.12.0. It was hard to troubleshoot, because:
Thank you for an otherwise wonderful piece of software! |
I had the error:
I use Sourcehut as remote hoster. I tried the following:
None of the above changed a thing. In the end |
|
When trying to clone a git repository for the first time using SSH and authentifying with an SSH key, I get the error "Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format".
I have tried transferring the passphrase using a web server, ASCII Armored QR, and iTunes file sharing. I made sure the passphrase is correct, but it does not work at all.
This happenened after I reset the app in order to clone a new password store. For almost a year, the app worked as intended. An uninstall/reinstall did not fix the problem. The key itself is good too, as I can use it on my PC.
I got this error on both an iPhone and an iPad on iOS 12.0.0.
The text was updated successfully, but these errors were encountered: