Open Jaywann opened 5 years ago
I got this issue with AIX as my target host. using sshj-0.21.1 fixed my issue
Got the same error, is there any workaround then downgrading? Using 0.31 from Maven. After successful upload, getting this Error Message. Target System is a Windows Server Running an SFTP Service.
Update: I think i got it to work, was using File instead of FileSystemFile
I am trying to execute a simple "help" command on a hardware appliance with sshj. As it is common for such appliances only a restricted shell is available. The code used was taken from net/schmizz/sshj/examples/ with no modification other than using the password auth and seetting a PromiscuousVerifier().
The version used is 0.26.0 pulled from maven.
Using the net/schmizz/sshj/examples/Exec.java example results in the following error:
[main] INFO n.s.s.t.random.BouncyCastleRandom - Generating random seed from SecureRandom. [main] INFO n.s.sshj.transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0.26.0 [main] INFO n.s.sshj.transport.TransportImpl - Server identity string: SSH-1.99-IPSSH-6.7.0 [main] DEBUG net.schmizz.concurrent.Promise - Setting <> to >
[main] DEBUG net.schmizz.concurrent.Promise - Setting <> to >
[reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Sending SSH_MSG_KEXDH_INIT
[reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Received SSH_MSG_KEXDH_REPLY
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to > to >
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to >
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to >
[reader] ERROR n.s.sshj.transport.TransportImpl - Dying because - Broken transport; encountered EOF
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:57)
[reader] INFO n.s.sshj.transport.TransportImpl - Disconnected - UNKNOWN
[main] ERROR net.schmizz.concurrent.Promise - <> woke to: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to
null
[reader] DEBUG net.schmizz.concurrent.Promise - Awaiting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <null
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Setting <null
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Setting <null
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <true
[main] DEBUG net.schmizz.concurrent.Promise - Setting <null
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <SOME
[main] INFO n.s.sshj.transport.TransportImpl - Disconnected - BY_APPLICATION [main] DEBUG net.schmizz.concurrent.Promise - Setting <SOME
Exception in thread "main" net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF at net.schmizz.sshj.transport.Reader.run(Reader.java:57)The error seams to occur at net/schmizz/sshj/Reader.run because imp.read() returning -1.
The odd thing is that when using the example code from net/schmizz/sshj/examples/RudimentaryPTY.java the restricted command prompt appears and commands can be entered:
[main] INFO n.s.s.t.random.BouncyCastleRandom - Generating random seed from SecureRandom. [main] INFO n.s.sshj.transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0.26.0 [main] INFO n.s.sshj.transport.TransportImpl - Server identity string: SSH-1.99-IPSSH-6.7.0 [main] DEBUG net.schmizz.concurrent.Promise - Setting <> to >
[main] DEBUG net.schmizz.concurrent.Promise - Setting <> to >
[reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Sending SSH_MSG_KEXDH_INIT
[reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Received SSH_MSG_KEXDH_REPLY
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to > to >
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to > to >
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to
null
[reader] DEBUG net.schmizz.concurrent.Promise - Awaiting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <null
[reader] DEBUG net.schmizz.concurrent.Promise - Setting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Setting <null
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <SOME
[main] DEBUG net.schmizz.concurrent.Promise - Setting <null
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <true
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<chan#0 / open>> [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<chan#0 / open>> toSOME
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<chan#0 / chanreq for pty-req>> [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<chan#0 / chanreq for pty-req>> toSOME
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<chan#0 / chanreq for shell>> [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<chan#0 / chanreq for shell>> toSOME
CLI> help
Using the RudimentaryPTY.java to manually write an InputStream to the StreamCopier appears to work at first but then encounters the same error.
[main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<chan#0 / close>> CLI> help clear disk-error - Clear the error information stored in disks. [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<chan#0 / close>> to> to > to
SOME
[stdout] DEBUG net.schmizz.concurrent.Promise - Setting <SOME
[stderr] DEBUG net.schmizz.concurrent.Promise - Setting <SOME
[reader] ERROR n.s.sshj.transport.TransportImpl - Dying because - Broken transport; encountered EOF net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF at net.schmizz.sshj.transport.Reader.run(Reader.java:57) [reader] INFO n.s.sshj.transport.TransportImpl - Disconnected - UNKNOWNAny help in determining the root cause of this is greatly appreciated.