Connection to Azure SFTP doesnt work using JSCH

Brandl, Fabian 21 Reputation points
2022-01-27T20:56:28.38+00:00

Hello everyone,

we are currently working with a cloud product that uses JSCH internally to connect to external sftp sources. Im investigating an connection reset exception that we are getting when trying to connect to azure sftp.

Using wireshark i determined that the problem occurs after jsch initializes the client: key exchange. Establishing the same connection with filezilla we dont have this issue.
comparing the packages from jsch and filezilla i didn't see an obivious issues, jsch has azure supported algorithms in the key exchange request at least it looks like it to me but im not an expert on the ssh protocol. Im gonna post both requests below if somebody could give me any pointers it would be greatly appreciated.

jsch request that leads to azure closing the connection:

169128-jsch.jpg

filezilla request that works:

169188-filezilla.jpg

jsch log output:

INFO: Connecting to ***** port 22  
INFO: Connection established  
INFO: Remote version string: SSH-2.0-AzureSSH_1.0.0  
INFO: Local version string: SSH-2.0-JSCH-0.1.54  
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256  
INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521  
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521  
INFO: SSH_MSG_KEXINIT sent  
INFO: Disconnecting from **** port 22  
com.jcraft.jsch.JSchException: Session.connect: java.net.SocketException: Connection reset  
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,706 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sumarigo-MSFT 43,801 Reputation points Microsoft Employee
    2022-01-30T10:28:10.563+00:00

    @Brandl, Fabian Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

    I see you have posted the similar thread in SO forum, Please refer to the suggestions mentioned over-there and let me know if the issue still persist. I would like to work closer on this issue

    Looking forward for your reply!

    ----------

    Please do not forget to 169643-screenshot-2021-12-10-121802.png and 169548-image.png wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. Juncheng Zhou 6 Reputation points
    2022-04-15T01:55:42.703+00:00

    Actually, SAP is using JSCH as sftp provider, and my customers cannot use it to connect to Azure SFTP. Any progress or update here?

    1 person found this answer helpful.