maks / MGit

A Git client for Android.
https://manichord.com/projects/mgit.html
GNU General Public License v3.0
1.26k stars 169 forks source link

Git repository throw ssh with username and password #99

Open VinTz1 opened 7 years ago

VinTz1 commented 7 years ago

Hello, I'm trying to clone a repository that is accessible throw ssh (I can connect to it with "connectBot") with username and password authentication. However when It try to clone it I get the message: "Exception caught during execution of fetch command" without any further information. Is this a bug or something that i'm doing wrong? Thanks.

maks commented 7 years ago

Hi, thanks for filing the issue. Are you using a ssh key with a password on it? If so unfortunately MGit doesn't yet support that, though its a feature a lot of people have asked for so its at the top of my todo list.

justdave commented 7 years ago

Is this a duplicate of #66 ?

tanty commented 4 years ago

Still suffering from this on v1.5.5.1 from F-Droid.

Using Android 7.1.2 from LineageOS v14.1.

The problem happens with a repo using SSH with user and password.

I installed MGit along SGit and got the same repo to be used by both apps.

SGit can run a pull perfectly. MGit cannot. It pops up the "user" and "password" request dialog and, after writing them, it spits an error and offers to send a crash report (which I sent, anonymizing the URL of my repo).

kb-1000 commented 4 years ago

Could you please provide that report here?

tanty commented 4 years ago
USER_COMMENT=
ANDROID_VERSION=7.1.2
APP_VERSION_NAME=1.5.5.1
BRAND=Xiaomi
PHONE_MODEL=2014813
CUSTOM_DATA=
STACK_TRACE=org.eclipse.jgit.api.errors.TransportException: ssh://xxxxxxxxx/xxx.git: Auth cancel
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:261)
at me.sheimi.sgit.repo.tasks.repo.PullTask.pullRepo(PullTask.java:99)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:30)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:15)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://xxxxxxxxx/xxx.git: Auth cancel
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 10 more
Caused by: com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:518)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
... 17 more
org.eclipse.jgit.errors.TransportException: ssh://xxxxxxxxx/xxx.git: Auth cancel
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:261)
at me.sheimi.sgit.repo.tasks.repo.PullTask.pullRepo(PullTask.java:99)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:30)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:15)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:518)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
... 17 more
com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:518)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:261)
at me.sheimi.sgit.repo.tasks.repo.PullTask.pullRepo(PullTask.java:99)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:30)
at me.sheimi.sgit.repo.tasks.repo.PullTask.doInBackground(PullTask.java:15)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
maks commented 4 years ago

If you have more than 1 set of ssh credentials this might be fixed with #492

tanty commented 4 years ago

If you have more than 1 set of ssh credentials this might be fixed with #492

As commented, the problem is with username and password, not with private keys.

mwberry commented 4 years ago

I'm also seeing this issue, on version 1.5.10 from the Play Store

On a server:

  1. git init foobar

On phone:

  1. Install and open the app
  2. Allow access to storage
  3. Agree to data collection (urgh, really? No opt out?)
  4. Hit [+] to add a repo
  5. Remote URL: ssh://example.com/path/to/repo
  6. Local Path: repo (auto filled)
  7. Init Local: unchecked
  8. Clone recursively: unchecked
  9. Hit [Clone] button
  10. Two dialogs appear, one obfuscating the other. The higher one reads:
    1. Title: Error occurred
    2. Message: Clone failed \n ssh://example.com/path/to/repo: Auth cancel
    3. Button: [ok]
  11. Hit [ok] button to reveal lower dialog
    1. Title: Needs Authentication
    2. Input: [Username]
    3. Input: [Password]
    4. Save username and password: unchecked
    5. Buttons: [CANCEL] [DONE]
  12. Enter SSH username & password
  13. Hit [DONE]
  14. The same two dialogs as step 10 appear, this will loop indefinitely until [CANCEL] is hit in step 19.
sgtpep commented 3 years ago

The same issue for me with MGit from F-Droid.

antenando commented 2 years ago

Same here....

Man-Chicken commented 9 months ago

I'm seeing the same issue, with the steps described by @mwberry, using a fresh version 1.7.0 from F-Droid on a Note 9 with Android 10 (and One UI 2.5).

maks commented 9 months ago

This is a FAQ due to GitHub no longer supporting password authentication with SSH, if you are facing a different problem please open a new issue.

Man-Chicken commented 9 months ago

This is a FAQ due to GitHub no longer supporting password authentication with SSH, if you are facing a different problem please open a new issue.

I'm not using GitHub repo in this instance. Actually, none of the comments (nor the original report) mention GitHub, so I don't think the FAQ is necessarily relevant here. I can open a new issue, but the report will basically be the same as what's described in this one.

tanty commented 9 months ago

@maks no, this issue is not about GitHub no longer supporting password authentication with SSH.

Please, consider reopening this issue or, at least, providing a different reason for closing this.

maks commented 9 months ago

@Man-Chicken or @tanty are you able to provide a publicly accessible git remote where this is happening? Otherwise is very hard to even know how to reproduce the issue.

Man-Chicken commented 9 months ago

@Man-Chicken or @tanty are you able to provide a publicly accessible git remote where this is happening? Otherwise is very hard to even know how to reproduce the issue.

@maks No, I've encountered this using a private repo. The "on phone" steps that @mwberry are precisely what I'm doing on the phone. As far as repo setup goes, it's straight forward creation of a repo for a preexisting directory with content. To be precise:

On server:

On a desktop machine:

I hope that's helpful!