Giter VIP home page Giter VIP logo

Comments (7)

norrisjeremy avatar norrisjeremy commented on June 28, 2024 2

HI @jsundmannorberg,

In #64 I've included ssh-agent support based upon jsch-agent-proxy.
Once it is landed, you should be able to activate along the lines of this:

      JSch jsch=new JSch();

      IdentityRepository irepo = new AgentIdentityRepository(new SSHAgentConnector());
      jsch.setIdentityRepository(irepo);

The empty SSHAgentConnector class constructor will attempt to to use Java 16's JEP 380 if you are running on Java 16+, else it will fall back to trying to use the junixsocket library if it is on the classpath. There are also various constructors to manually specify a specific USocketFactory instance (UnixDomainSocketFactory or JUnixSocketFactory, or even a custom implementation), as well as specifying the filesystem path of the ssh-agent's unix domain socket instead of trying to use the SSH_AUTH_SOCK env variable.

I've not tested the PageantConnector class since I am not a Windows user, but if it was working with the old jsch-agent-proxy, then I imagine it should still work now. Using it requires that the JNA library be included on the classpath.

Thanks,
Jeremy

from jsch.

norrisjeremy avatar norrisjeremy commented on June 28, 2024

Hi @jsundmannorberg,

When I have some free time, I may take a look at this and see what it would entail.
Out of curiosity, which components from the original jsch-agent-proxy would you require for your particular use cases?

  1. Do you only require the support for traditional ssh-agent? Or do you also need the support for Pageant?
  2. Do you require the integration support it provides with SSHJ & trilead-ssh2? Or do you require its support with JSch?
  3. Also If you require the traditional ssh-agent support, would you need support for it with Java versions prior to Java 16?

Thanks,
Jeremy

from jsch.

jsundmannorberg avatar jsundmannorberg commented on June 28, 2024

Hi Jeremy!

Thanks for looking at this (if you have time)! It would be incredibly useful to us.

  1. It would be great to support both ssh-agent and Pageant.
  2. We are using this fork of JSch, so that is what we need support for.
  3. For our use case we need to support older Java versions as well, definitely Java 11. And in the future we will also need support for Java 17.

Thanks!
Johan

from jsch.

jsundmannorberg avatar jsundmannorberg commented on June 28, 2024

Thanks @norrisjeremy for the amazingly fast response , this looks like exactly what we need!

from jsch.

mwiede avatar mwiede commented on June 28, 2024

@jsundmannorberg can you please test latest release 0.1.66 (should be available on maven central in the next 24 hours), if it fits your needs?

from jsch.

jsundmannorberg avatar jsundmannorberg commented on June 28, 2024

Absolutely, I will test it as soon as possible

from jsch.

jsundmannorberg avatar jsundmannorberg commented on June 28, 2024

Thanks again for the fast response, this works perfectly for our needs.

from jsch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.