Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-614

SCP upload fails with dropbear server (aka server with paket size limitation)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None

    Description

      When trying to upload a file via SCP to a server running dropbear I get the following error:

      java.io.EOFException: readAck - EOF before ACK -
      at org.apache.sshd.common.scp.ScpHelper.readAck() in ScpHelper.java:703.
      at org.apache.sshd.common.scp.ScpHelper.sendStream() in ScpHelper.java:539.
      at org.apache.sshd.client.scp.DefaultScpClient.upload() in DefaultScpClient.java:104.
      at org.apache.sshd.client.scp.AbstractScpClient.upload() in AbstractScpClient.java:201.

      The main difference between dropbear and OpenSSH I have encountered is that dropbear has a paket size limitation in place by default. That's the reason in the first place why I even need to upload files via SCP since using trying to execute bigger scripts via an exec channel it will fail. I attached logs from the system that fails and another system. The main difference seems to be this:

      working (OpenSSH):
      DEBUG [sshd-SshClient[51a8313b]-nio2-thread-9] (AbstractConnectionService.java:236) channelOpenConfirmation(ChannelExec[id=0, recipient=-1]-ClientSessionImpl[sshtest@XXXXXXXXX.XXXX.XXX/XX.XX.XX.XXX:22]) Received SSH_MSG_CHANNEL_OPEN_CONFIRMATION recipient=
      DEBUG [sshd-SshClient[51a8313b]-nio2-thread-9] (AbstractChannel.java:121) setRecipient(ChannelExec[id=0, recipient=-1]-ClientSessionImpl[sshtest@XXXXXXXXX.XXXX.XXX/XX.XX.XX.XXX:22]) recipient=0
      DEBUG [sshd-SshClient[51a8313b]-nio2-thread-9] (Window.java:122) init(ChannelExec[id=0, recipient=0]-ClientSessionImpl[sshtest@XXXXXXXXX.XXXX.XXX/XX.XX.XX.XXX:22]: client remote window) size=0, max.=0, packet=32768
      DEBUG [sshd-SshClient[51a8313b]-nio2-thread-9] (ChannelExec.java:47) doOpen(ChannelExec[id=0, recipient=0]-ClientSessionImpl[sshtest@XXXXXXXXX.XXXX.XXX/XX.XX.XX.XXX:22]) send SSH_MSG_CHANNEL_REQUEST exec command=scp -p -t – /tmp/XXXXX_script.sh

      not working (dropbear):
      DEBUG [sshd-SshClient[11389053]-nio2-thread-7] (AbstractConnectionService.java:236) channelOpenConfirmation(ChannelExec[id=0, recipient=-1]-ClientSessionImpl[test@/XX.XX.XX.XXX:44]) Received SSH_MSG_CHANNEL_OPEN_CONFIRMATION recipient=
      DEBUG [sshd-SshClient[11389053]-nio2-thread-7] (AbstractChannel.java:121) setRecipient(ChannelExec[id=0, recipient=-1]-ClientSessionImpl[test@/XX.XX.XX.XXX:44]) recipient=0
      DEBUG [sshd-SshClient[11389053]-nio2-thread-7] (Window.java:122) init(ChannelExec[id=0, recipient=0]-ClientSessionImpl[test@/XX.XX.XX.XXX:44]: client remote window) size=24576, max.=24576, packet=32759
      DEBUG [sshd-SshClient[11389053]-nio2-thread-7] (ChannelExec.java:47) doOpen(ChannelExec[id=0, recipient=0]-ClientSessionImpl[test@/XX.XX.XX.XXX:44]) send SSH_MSG_CHANNEL_REQUEST exec command=scp -p -t – /tmp/XXXXX_script.sh

      As you can see that's a min/max set for the not working dropbear.

      There's also two typos in this log message (the additional whitespace at "client local" and the period at "max":
      DEBUG [forceDeviceActionAsync] (Window.java:122) init(ChannelExec[id=0, recipient=-1]-ClientSessionImpl[test@/10.48.43.214:44]: client local window) size=2097152, max.=2097152, packet=32768

      I am using the latest version of master.

      Attachments

        1. dropbear_not_working.log
          15 kB
          Oliver Stöneberg
        2. openssh_working.log
          20 kB
          Oliver Stöneberg
        3. scp_vvv.log
          10 kB
          Oliver Stöneberg

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Firewave Oliver Stöneberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: