About Trilead SSH open source project
November 13, 2008
Some time ago I have written an article about the JSch open source project. However, I soon lost all my motivation when I faced, again, the code complexity required for JSch just to start a execution session, a file copy or a port forwarding with JSch. Nevertheless the completely misunderstood authentication API for JSch let me to a mood even worse. I started looking for alternatives and fortunately I found Trilead SSH, a pure Java implementation of SSH, available with the BSD license.
I have not yet tested Trilead SSH extensively to state that it provides a stable and complete SSH implementation. But results were very promising. Unfortunately, I have not much information about performance of data transfer with Trilead SSH.
I think that the major advantage of Trilead SSH is its very simple and intuitive API, directly targeted to tasks that shall be solved for someone that is using SSH. Everything is made very easy: execute a command, do port forwarding, transfer files. All complexity is done behind the scenes and a single method call uses to be enough. There is no need to care about SSH details as it was required for JSch.
In special, I liked the Trilead SSH API resposible for authentication that is very straightforward and matches very well the steps to log into the remote host. Even better, I was able to implement my own logic to respond to authentication failure exactly to the application needs. In this situation Trilead SSH is simplier and more flexible that JSch.
As a drawback, it is not possible to have low level access to the SSH protocol. However, this seems to be a very improbable requirement.
Depite of the simple API, Trilead SSH claims to implement all major ssh features: sessions (remote command execution and shell access), X11 forwarding, local and remote port forwarding, local stream forwarding, SCP and SFTP. Many options are available for authentication methods and cipher types.
The API is very well documented and includes examples and advices, what is very rare on a typical javadoc.
Conclusion
Replacing JSch by Trilead SSH has been a good choice, although I have not yet evidences for better performance nor stability. But the code become considerable simpler and shorted. And development time was reduces many times.
Entry Filed under: planetLTC. .
4 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed
1. Chris Dornin | February 20, 2009 at 3:24 pm
I have used both jsch and trilead ssh libraries. I have also done ssh/scp by tunneling down to the native operating system to access ssh/scp using a java runtime process. The best approach has been the trilead ssh library, which unfortunately I found last. I got into problems with jsch doing multithreaded calls and as the author describes above, jsch isn’t well documented. The trilead ssh library worked beautifully. I have done the following tests:
1. multithreaded ssh/scp.
2. weird command syntax in my ssh calls, like pipes, etc. This works flawlessly (not so with native ssh accessed via java runtime).
3. I install a complex j2ee environment with oracle schemas, jboss instances, ldap, etc by using the trilead library for ssh calls. The environment installs consistently, implying that trilead ssh is solid.
I can’t speak to performance, but it seems pretty good to me. I am grateful for the trilead open source project.
2. Konstantin | May 20, 2009 at 6:26 pm
Yeah, that’s great library!!
My choose for client tasks is trilead.
It has very flexible and beautiful source code. It was easy to modify sources for my-own tasks (e.x. I added own-type channel support).
Also I can recommend this library as a pure java SSHclient and sshd implementation.
P.S: But I was sad about this: http://www.trilead.com/SSH_Library/ T
:( – it’s nott supported and distributed more…
P.P.S: sorry again for my eng. it’s me again)
3. jjramos | June 1, 2009 at 11:04 am
Hi!
I’m still testing the library, but it seems to work smooth…
Konstantin, don’t be sad: I’ve found the trilead-SSH2 package in several linux distributions!
I’m using Fedora 10, and it includes the package. However, I haven’t found the sources yet… If you find it, please let me know!
4. Ben | October 13, 2009 at 2:42 am
You can find the last source here :
http://virologie.free.fr/documents/openSSH/ssh_liens.html (see the link on the Ganymed Project).