MINA SSHD
  1. MINA SSHD
  2. SSHD-55

Support for SFTP on the server side

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Labels:
      None
    1. SSHD-55-patchv3.diff
      10 kB
      Patrick Dessalle
    2. SSHD-55.txt
      35 kB
      Guillaume Nodet
    3. SSHD-52-v2.patch
      41 kB
      Stephen Connolly
    4. file_of_size_71bytes.log
      0.1 kB
      Patrick Dessalle

      Issue Links

        Activity

        Hide
        Guillaume Nodet added a comment -

        Very basic / untested support for SFTP on the server side.
        Anyone wanting to have a look and provide feedback / enhancements, please go ahead!

        Show
        Guillaume Nodet added a comment - Very basic / untested support for SFTP on the server side. Anyone wanting to have a look and provide feedback / enhancements, please go ahead!
        Hide
        Stephen Connolly added a comment -

        Updated this patch to r900692, added a basic unit test

        Show
        Stephen Connolly added a comment - Updated this patch to r900692, added a basic unit test
        Hide
        Guillaume Nodet added a comment -

        Stephen, could you please remove the copyright header on top of the test files and put a standard apache header so that i can include the patch in trunk ?
        Also, have you seen any problems with the current implementation of sftp ? Do you use it ?

        Show
        Guillaume Nodet added a comment - Stephen, could you please remove the copyright header on top of the test files and put a standard apache header so that i can include the patch in trunk ? Also, have you seen any problems with the current implementation of sftp ? Do you use it ?
        Hide
        Patrick Dessalle added a comment -

        I've put a patch (just for the SftpSubsystem.java file) with fixes for SFTP support.
        It's mainly for SFTP v3, with small parts for v4 and v5 but v3 is used by default.

        Tested with OpenSSH's SFTP client, Putty SFTP, WinSCP and FileZilla (use Putty SFTP in the background).
        It's not perfect (the date and size of the file is not properly read in WinSCP and FileZilla) but it runs.

        WinSCP and FileZilla also require the patch in SSHD-77 in order to establish a connection.

        Show
        Patrick Dessalle added a comment - I've put a patch (just for the SftpSubsystem.java file) with fixes for SFTP support. It's mainly for SFTP v3, with small parts for v4 and v5 but v3 is used by default. Tested with OpenSSH's SFTP client, Putty SFTP, WinSCP and FileZilla (use Putty SFTP in the background). It's not perfect (the date and size of the file is not properly read in WinSCP and FileZilla) but it runs. WinSCP and FileZilla also require the patch in SSHD-77 in order to establish a connection.
        Hide
        Patrick Dessalle added a comment -

        When doing some more testings, I found out that SSHD seems to have some issues to handles files with specific size. I've created files ranging from 50 to 400 bytes and it looks like that starting at 71 bytes, an exception is generated by SSHD itself (before any processing by the subsystem).

        It crashes with an EOFException on the InputStream.

        I've attached such a file. I've transfered bigger files that had absolutely no issue. I did try to debug it but I could not fix it. Now I just hope that someone else could find a lead to a fix.

        Show
        Patrick Dessalle added a comment - When doing some more testings, I found out that SSHD seems to have some issues to handles files with specific size. I've created files ranging from 50 to 400 bytes and it looks like that starting at 71 bytes, an exception is generated by SSHD itself (before any processing by the subsystem). It crashes with an EOFException on the InputStream. I've attached such a file. I've transfered bigger files that had absolutely no issue. I did try to debug it but I could not fix it. Now I just hope that someone else could find a lead to a fix.
        Hide
        Mathieu Pasture added a comment -

        I would like to provide more info on the previous comment: files are failing in range of 128 bytes, after a first block of 70.
        1-70 success
        71-198 error
        199-326 success
        327-454 error
        455-582 success
        583-711 error
        712-838 success
        839-966 error
        ...

        I have tried to change the different buffers and windows size with no positive effect. Any idea?
        Thanks.

        Show
        Mathieu Pasture added a comment - I would like to provide more info on the previous comment: files are failing in range of 128 bytes, after a first block of 70. 1-70 success 71-198 error 199-326 success 327-454 error 455-582 success 583-711 error 712-838 success 839-966 error ... I have tried to change the different buffers and windows size with no positive effect. Any idea? Thanks.
        Hide
        Guillaume Nodet added a comment -

        Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ...
        M sshd-core/src/main/java/org/apache/sshd/common/util/Buffer.java
        A sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
        A sshd-core/src/test/java/org/apache/sshd/SftpTest.java
        Committed r939223

        I have been unable to reproduce the mentioned issue will file size.
        Please open a new issue for specific problems now that this has been included in trunk.

        Show
        Guillaume Nodet added a comment - Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ... M sshd-core/src/main/java/org/apache/sshd/common/util/Buffer.java A sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java A sshd-core/src/test/java/org/apache/sshd/SftpTest.java Committed r939223 I have been unable to reproduce the mentioned issue will file size. Please open a new issue for specific problems now that this has been included in trunk.

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Guillaume Nodet
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development