hierynomus / sshj

ssh, scp and sftp for java
Apache License 2.0
2.46k stars 594 forks source link

Connection reset problem: Dying because - Connection reset #949

Open JeremiasTrouble opened 6 days ago

JeremiasTrouble commented 6 days ago

So, I was trying to reach the sftp server to list some files, but when I tried I received this message:

` 2024-06-27 08:50:13.809 INFO 9144 --- [ XNIO-1 task-1] n.s.sshj.transport.random.JCERandom : Creating new SecureRandom. 2024-06-27 08:50:13.836 INFO 9144 --- [ XNIO-1 task-1] n.schmizz.sshj.transport.TransportImpl : Client identity string: SSH-2.0-SSHJ_0.31.0 2024-06-27 08:50:13.870 INFO 9144 --- [ XNIO-1 task-1] n.schmizz.sshj.transport.TransportImpl : Server identity string: SSH-2.0-OpenSSH_8.7 2024-06-27 08:50:14.432 ERROR 9144 --- [ reader] n.schmizz.sshj.transport.TransportImpl : Dying because - Connection reset

java.net.SocketException: Connection reset at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186) ~[na:na] at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140) ~[na:na] at net.schmizz.sshj.transport.Reader.run(Reader.java:50) ~[sshj-0.31.0.jar:0.31.0]

2024-06-27 08:50:14.432 INFO 9144 --- [ reader] n.schmizz.sshj.transport.TransportImpl : Disconnected - UNKNOWN 2024-06-27 08:50:14.432 ERROR 9144 --- [ XNIO-1 task-1] net.schmizz.concurrent.Promise : <<chan#0 / open>> woke to: net.schmizz.sshj.connection.ConnectionException: Connection reset

The code I use for this is the next:

`
SFTPClient client = SetupSshClient.setupSshj(itxUrl, itxUser, itxPassword).newSFTPClient();

    Flows flow = this.flowService.findById(serviceId);

    Set<String> folders = new HashSet<>();`

I tried the sftp connection with FileZilla and it worked, but when i tried to create files there was a problem when creating 'em, so I wass thinking it is the end side, the permissions of the folders and files, but i'm not sure about this :( if someone can help please!!