-
Notifications
You must be signed in to change notification settings - Fork 41
/
README
94 lines (79 loc) · 3.99 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
jsch-agent-proxy -- a proxy to ssh-agent and Pageant in Java.
Description
===========
jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent and Pageant
included Putty. It will be easily integrated into JSch, and users
will be allowed to use those programs in authentications.
This software has been developed for JSch, but it will be easily
applicable to other ssh2 implementations in Java.
This software is licensed under BSD style license.
Build
=====
$ git clone git://github.com/ymnk/jsch-agent-proxy.git
$ cd jsch-agent-proxy
$ mvn package
$ mvn install
Examples
========
* UsingPageant.java
This sample demonstrates how to get accesses to Pageant.
$ cd examples
$ mvn compile
$ mvn exec:java \
-Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.UsingPageant"
* UsingSSHAgent.java
This sample demonstrates how to get accesses to ssh-agent.
$ cd examples
$ mvn compile
$ mvn exec:java \
-Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.UsingSSHAgent"
* JSchWithAgentProxy.java
This sample demonstrates how to integrate jsch-agent-proxy into JSch.
$ cd examples
$ mvn compile
$ mvn exec:java \
-Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.JSchWithAgentProxy" \
-Dexec.args="[email protected]"
* SshjWithAgentProxy.java
This sample demonstrates how to integrate jsch-agent-proxy into sshj.
$ cd examples
$ mvn compile
$ mvn exec:java \
-Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.SshjWithAgentProxy" \
-Dexec.args="[email protected]"
* TrileadWithAgentProxy.java
This sample demonstrates how to integrate jsch-agent-proxy into Trilead SSH2 (SVNKit fork).
$ cd examples
$ mvn compile
$ mvn exec:java \
-Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.TrileadWithAgentProxy" \
-Dexec.args="[email protected] date"
Dependencies
============
To work as a proxy to ssh-agent and Pageant,
the current implementation depends on the following software
* JNA: https://github.com/twall/jna licensed under the GNU LGPL and the Apache License 2.0
* junixsocket: http://code.google.com/p/junixsocket/ licensed under the Apache License 2.0
* OpenBSD's netcat: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
As for connections to ssh-agent, unix domain sockets must be
handled, and JNA or junixsocket have been used for that purpose.
Refer to to following classes,
* com.jcraft.jsch.agentproxy.usocket.JNAUSocketFactory[1]
* com.jcraft.jsch.agentproxy.usocket.JUnixDomainSocketFactory[2]
* com.jcraft.jsch.agentproxy.usocket.NCUSocketFactory[3]
NCUSocketFactory expects the external command nc(OpenBSD's netcat), but
you don't have to install other third party software.
As for connections to Pageant, win32 APIs must be
handled, and JNA has been used in the current implementation for that purpose.
Refer to the following class,
* com.jcraft.jsch.agentproxy.connector.PageantConnector[3]
If you want to be free from JNA and junixsocket,
implement following interfaces without them,
* com.jcraft.jsch.agentproxy.Connector[4]
* com.jcraft.jsch.agentproxy.USocketFactory[5]
[1] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-usocket-jna/src/main/java/com/jcraft/jsch/agentproxy/usocket/JNAUSocketFactory.java
[2] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-usocket-junixsocket/src/main/java/com/jcraft/jsch/agentproxy/usocket/JUnixDomainSocketFactory.java
[3] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-usocket-nc/src/main/java/com/jcraft/jsch/agentproxy/usocket/NCUSocketFactory.java
[4] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-pageant/src/main/java/com/jcraft/jsch/agentproxy/connector/PageantConnector.java
[5] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-sshagent/src/main/java/com/jcraft/jsch/agentproxy/Connector.java
[6] https://github.com/ymnk/jsch-agent-proxy/blob/master/jsch-agent-proxy-core/src/main/java/com/jcraft/jsch/agentproxy/USocketFactory.java