Hi there!
I am trying to build SSHJ for inclusion in Text2GUI (
http://text2gui.tinybrain.de). Let me tell you: It's hard!!!
Here are my notes:
Satisfying the requirements for SSHJ is quite a bitch...
JCraft was easy.
slf4j has SO many jars to choose from...
bouncycastle v150 (the latest) does not provide class PEMReader.
For bouncycastle v140 I did find the "bcprov" jar, but not the "bcpkix" jar, so I took that from v150. Hope that works.
I now have these libs in the project:
-rw-rw-r-- 1 stefan stefan 598674 Dec 18 00:46 bcpkix-jdk15on-150.jar
-rw-rw-r-- 1 stefan stefan 1593423 Dec 18 00:54 bcprov-jdk15-140.jar
-rw-rw-r-- 1 stefan stefan 2732684 Dec 18 00:44 bcprov-jdk15on-150.jar
-rw-r--r-- 1 stefan stefan 26084 Mar 25 2013 slf4j-api-1.7.5.jar
I have included jzlib as source files, SSHJ also as sources.
Upshot: I can do SSH comands with password auth.
But with public key auth I'm getting these errors:
User: root. Password: Exception in thread "main" net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:217)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:316)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:365)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:295)
at sshjtest.TestSSH.main(TestSSH.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: net.schmizz.sshj.userauth.UserAuthException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
at net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:33)
at net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:26)
at net.schmizz.concurrent.Promise.deliverError(Promise.java:95)
at net.schmizz.sshj.userauth.UserAuthImpl.notifyError(UserAuthImpl.java:151)
at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:579)
at net.schmizz.sshj.transport.Reader.run(Reader.java:79)
Caused by: net.schmizz.sshj.common.SSHException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
at net.schmizz.sshj.common.SSHException$1.chain(SSHException.java:56)
at net.schmizz.sshj.common.SSHException$1.chain(SSHException.java:49)
at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:573)
... 1 more
Caused by: java.lang.SecurityException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
TL;DR: Is there a working binary package for SHHJ PLUS dependencies???
That would be HIGHLY appreciated.
Thanks a lot,
Stefan