hierynomus / sshj

ssh, scp and sftp for java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to connect DMZ node with SSHJ

sivaprasadjava opened this issue · comments

Hi Team,

I hope all are doing great, I'm using SSHJ to execute remote commands execution and file uploads/downloads. everything is working fine but while connecting to the DMZ Remote node( we have proper access to connect ) facing connection timeout issues.

I'm using the .34.0 version, can someone please help me to overcome this issue. thanks for your all time and efforts.

Thanks,
Siva.

Sorry, my crystal ball seems broken.... In other words, please provide a ton more details except what role your host has and that you're getting a timeout...

  • What are you trying
  • What logging do you see
  • etc

Hi @hierynomus

Thanks for your replay :)

I have to connect and execute some unix commands on the DMZ node with Java code, we have the required permissions to connect and execute commands on it, and with Apache Mina I'm able to execute commands and file uploads/downloads as well. when I used SSHJ to execute Unix commands and file upload/downloads, I'm not able to connect the DMZ node I'm getting below print stack trace.

net.schmizz.sshj.transport.TransportException: Connection reset
at net.schmizz.sshj.transport.TransportImpl.init(TransportImpl.java:165)
at net.schmizz.sshj.SSHClient.onConnect(SSHClient.java:807)
at net.schmizz.sshj.SocketClient.connect(SocketClient.java:69)

Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.net.SocketInputStream.read(SocketInputStream.java:224)
at net.schmizz.sshj.transport.TransportImpl.receiveServerIdent(TransportImpl.java:193)
at net.schmizz.sshj.transport.TransportImpl.init(TransportImpl.java:158)
... 12 more

I'm using the 0.43.0 version of sshj. let me know if anything is required.

Thanks,
Siva.

Hi @hierynomus / @DanWiseProgramming, can you please help me to overcome this, thanks for your time.

Hi @sivaprasadjava ,
In order to help you, I need more information:

  1. Provide the full output from an ssh -vvv <target user>@<target host> <target command> command which accomplishes what you are trying to do.
  2. Provide the code which you are using to accomplish the same with SSHJ.
  3. Provide a full stack-trace of the error thrown by SSHJ.
  4. Provide proof that the server is online and accessible at the time of attempting to run the SSHJ code.

Without this information, I'm afraid I won't be able to help.