SSH Server in Java

ServiceMix Kernel is a small container based on OSGi. The latest release allows external clients to connect to it and issue commands using a simple protocol implemented on top of TCP or SSL. However, this remoting protocol has some drawbacks as the internals makes it unable to do another remote login from a remote session. In addition to that, completion and history do not really work great.

So I've been thinking about using the SSH protocol, which is widely used, secured, with tons of different clients available. Unfortunately, no SSH server is available in Java. Over the past weeks, I've been working on implementing this SSH server, based on the IEFT specifications, the JSch SSH client library, and the OpenSSH server source code. The server itself is based on Apache Mina which is a great framework for using NIO.

The project is available at and although there are lots of limitations right now, the basics of the SSH protocol work. I plan to integrate it in a bit into ServiceMix Kernel as the default remoting protocol. Maybe over time, we'll be able to implement SFTP or even a full SSH server integrated with Unix OS (I've already made some tests, but I'm missing a few bits on the PAM integration for authenticating against the OS).

Anyway, if anyone want to contribute or have any problems trying to use it, just send me an email. I may set up a google group list for that later if there is any need.

Update: the code is now developed as a subproject of Apache Mina and available at


Hi Guillaume,

what about proposing the ssh server as a MINA subproject ?
Anonymous said…
Well ... amazing !
Anonymous said…
Cool, thanks!
Anonymous said…
Well done.
However JCraft has some issues with SSH servers. I am not sure whether it's the servers or the API.

The is another SSH API that's open source JAVA from Trilead.
Here is the link for them:

Maybe this will help too!

Regards Rick
Unknown said…
> Unfortunately, no SSH server is available in Java.

There's a SourceForge project
J2SSH / SSHTools which provides ssh client and server including sftp server.

It seems to be a fork of a commercial product, hasn't released new versions since 2003, but there's newer files as well.
Unknown said…
Sorry, the latest release is
J2SSH 0.2.9 released on May 20, 2007.
Noodle Soup said…
I've been working with J2SSH, and it's quite buggy. It seems like it was abandoned halfway through in favour of their commercial project. I have however committed what fixes I've made to the project to Google Code, which you're welcome to try using with no guarantee:

j2ssh-fork on Google Code

I'm using it specifically as an SFTP server, so I don't know how good the shell support is. Use it if it's useful.
Guillaume Nodet said…
Unfortunately, J2SSH is licensed under GPL and Apache projects are unable to use such licenses. FWIW, the code should move as an Apache Mina subproject soon. SFTP support is planned for use within Apache FTPServer.
Noodle Soup said…
Of course, I should have realised. Best of luck with your project - I have much greater confidence in Apache projects so if SFTP support arrives in either Mina or FTP Server I may well look into using that instead. Thanks for your reply.
Jason said…
I get:


Your client does not have permission to get URL /p/sshd/ from this server.

When I try to access:

Has this project disappeared?
Guillaume Nodet said…
Yes, I shut down the google project. The code is now available at Apache at
The apache project seems to have moved to this url:

Popular posts from this blog

Apache Karaf

Camel Endpoint DSL

ActiveMQ Pooling