Log in

Bekijk de volledige versie : sftp-server for wl500g?



monnier
17-04-2006, 16:09
Has anyonce compiled an sftp-server binary for the WL500g?

Oleg
18-04-2006, 12:41
Try openssh from the ipkg repository.

monnier
20-04-2006, 22:53
Try openssh from the ipkg repository.

Works great, thank you.
The only probem is that the dropbear that comes in the firmware tries to run /usr/libexec/sftp-server but /usr is read-only so I had to do some funny "mount -o bind" fiddling in order to actually be able to add the sftp-server where dropbear expects it.
Maybe that could be fixed in a future firmware? ;-)

Thanks Oleg.

ega2002
22-04-2006, 20:29
Works great, thank you.
... so I had to do some funny "mount -o bind" fiddling in order to actually be able to add the sftp-server where dropbear expects it.
monnier, could you please explain this in details
Thanx in advance

monnier
24-04-2006, 04:00
monnier, could you please explain this in details
Thanx in advance

Basically store the read-only /usr somewhere:


mount -o bind / /opt/flash

then mount some read-write directory over /usr:


mount -o bind /opt/usr /usr

and finally populate /opt/usr (now also known as /usr) with symlinks to /opt/flash/usr/* except for /opt/usr/libexec (which didn't exist and now contains a symlink to /opt/libexec/sftp-server) and /opt/usr/local which is a symlink to /tmp/local. The read-only /usr also has a symlink for /usr/tmp to ../tmp which I haven't bothered to recreate because it seems unnecesary.

ega2002
24-04-2006, 08:34
monnier,
Ok, but I thought it should be more simple. I tried another method, and it works fine for me. I copied dropbear executable to /opt/sbin and patched it to use /opt/libexec instead of /usr/libexec. Then I simply run this copy instead of built-in, and voila - sftp-server works perfectly well!