Open cloneit opened 1 year ago
Hi @cloneit,
Thanks, Jeremy
Hi @norrisjeremy ,
Yes. SSH-agent are running and keys are pre-loaded. Below are the logs from the machine:
[ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) Running ssh-add Identity added: *** [ssh-agent] Started.
Hi @cloneit,
I'm not sure then. You have supplied very little information that we can use to assist you.
All I can say is that the error message Auth fail for methods 'publickey'
means that the authentication to the server failed, which would indicate that the ssh-agent lacked a key that is authorized by the server to which you are connected.
Thanks, Jeremy
Hi @norrisjeremy ,
I can see both public and private keys getting pre-loaded in the logs. It is working with 0.1.55 version and Java version 8.
Now we are on Java v11 and using below lib versions.
Tried the workaround following these threads: https://github.com/mwiede/jsch/issues/85 and https://github.com/mwiede/jsch/issues/65
Added JunitSocketFactory lib as we are on Java11 and UnixDomainSocketFactory is available on Java v16+.
is it something missing from the implementation(code-snippet shared above)?
`<dependency>
<groupId>com.github.mwiede</groupId>
<artifactId>jsch</artifactId>
<version>0.2.8</version>
</dependency>`
`<dependency>
<groupId>com.kohlschutter.junixsocket</groupId>
<artifactId>junixsocket-core</artifactId>
<version>2.6.2</version>
<type>pom</type>
</dependency>`
`<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.3.2.201906051522-r</version>
</dependency>`
Hi @norrisjeremy ,
Did you got chance to look at my above reply?
Thanks, Ramesh
Hi @cloneit,
Based upon the limited information you have provided (as you still haven't enabled logging in JSch), we can only conclude that the issue you are having is one of the following:
Additionally, you appear to be using an old version of JGit (5.3.2.201906051522
) that was released almost four years ago instead of a more recent release, so it's quite possible that you are simply encountering some sort of issue in JGit.
Thanks, Jeremy
First of all, thank you maintaining this library.
I was facing Auth fail issue with Jsch 0.1.55 version. I recently saw this forked repository and tried to use the forked version of this Jsch version: 0.2.8. I am running on java_v11_oracle_runtime:0.18.1.
I am getting failure while running this for cloning a git repo using ssh-agent:
Auth fail for methods 'publickey' 11:32:22 at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:255) 11:32:22 at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:302) 11:32:22 at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
Below is the code snippet for creating a Jsch session using ssh-agent and SSHSessionFactory:
`SshSessionFactory.setInstance(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { session.setConfig("StrictHostKeyChecking", "false"); }
Would appreciate if you can help on this?
Thanks, Ramesh