OpenWrt Forum Archive

Topic: SFTP upload stalls at 8192 bytes

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I have successfully installed OpenWRT RC5 "White Russian" on my ASUS WL-500g Deluxe router. In order to backup my configuration files, I installed package "openssh-sftp-server". Works well so far.

Now that I tried to upload files to my router, I noticed that files smaller than or equal to 8192 bytes can be uploaded, while the upload of larger files will not complete. It stalls after 8192 bytes transfered.
I can download files of any size, in that direction there is no limit.

8192 = 2^13 -> Is this some magic limit?

Does anyone have an idea, what may be wrong configured on my router?
I have googled for similar symptoms, but it looks like I am the only one, who is facing that problem.

Any help is greatly appreciated.

Regards,

slowjoe

do you upload in /tmp or anywhere else? try to /tmp

Hello,

I got the same problem using RC5. Replace totally dropbear by openssh and this works.

Anael

Thanks for your quick replies!

@dev: Yes, I tried to upload to '/tmp' (actually, Filezilla displays '/tmp/').

@aorlinsk: I will try to replace dropbear by openssh tomorrow. Is this doable by being connected to the shell? I guess not, since the connection is established using dropbear. How did you do that? Using the web interface?

Regards,

slowjoe

Thanks Anael, this did the trick!
Although, I had some difficulties installing openssh, finally, I can upload large files.

This is how it worked for me using a Windows client:

1. Connect to the router via SSH (PuTTY)
2. Remove dropbear (ipkg remove dropbear)
3. Install openssh (ipkg install openssh-server)
4. Run the start script in order to create the keys. This step takes a while and results in an error, saying something like "keys cannot be found/accessed" (/etc/init.d/S50sshd)
5. Restart router (reboot)
6. Login to the router after reboot
7. SFTP uploads via Filezilla are successful

Thanks again,

slowjoe

I'm getting the 8192 limit on file uploads in FileZilla too. Is there any way to fix Dropbear or OpenWRT? I'd rather not remove it to install another package.

did someone solved this problem already?

i just found:

21         $(PKG_BUILD_DIR)/.configured: 
22                 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \ 
23                         $(TARGET_CONFIGURE_OPTS) \ 
24                         CFLAGS="$(TARGET_CFLAGS) -DMAX_UPLOAD_KB=8192" \ 
25                         ./configure \ 
26                           --target=$(GNU_TARGET_NAME) \ 
27                           --host=$(GNU_TARGET_NAME) \ 
28                           --build=$(GNU_HOST_NAME) \ 
29                           --program-prefix="" \ 
30                           --program-suffix="" \ 
31                           --prefix=/usr \ 
32                           --exec-prefix=/usr \ 
33                           --bindir=/usr/bin \ 
34                           --datadir=/usr/share \ 
35                           --includedir=/usr/include \ 
36                           --infodir=/usr/share/info \ 
37                           --libdir=/usr/lib \ 
38                           --libexecdir=/usr/lib \ 
39                           --localstatedir=/var \ 
40                           --mandir=/usr/share/man \ 
41                           --sbindir=/usr/sbin \ 
42                           --sysconfdir=/etc \ 
43                           $(DISABLE_LARGEFILE) \ 
44                           $(DISABLE_NLS) \ 
45                 ) 
46                 touch $@

on https://dev.openwrt.org/changeset/3752

thought, i can maybe set "DMAX_UPLOAD_KB", but with the dropbear help i didn't find a way.
can someone help?
or should i also change to openssh?

cheers, hannes

The discussion might have continued from here.