dropbear icon indicating copy to clipboard operation
dropbear copied to clipboard

please add the sftp-server, so a static dropbearmulti with sftp func is possible

Open MaxPeal opened this issue 3 years ago • 9 comments

please add a standalone version of OpenSSH's sftp-server program, so a make like:

./configure --enable-static
make PROGRAMS="dropbear dbclient scp" MULTI=1

for make a static dropbearmulti with sftp-server func is possible.

MaxPeal avatar Apr 07 '22 17:04 MaxPeal

It looks like OpenSSH's sftp-server would require at least a dozen .c files to build. It seems relatively separate from other parts of OpenSSH, though would still need various configure tests etc. Perhaps it could be added in a subdirectory - I'm not sure if I'll get to it myself but I wouldn't object if someone wants to add it. Of course we might then need to add sftp client too if OpenSSH removes scp as a server.

mkj avatar Apr 08 '22 02:04 mkj

And not a import but an easy option in the makefile to auto integrate a separate automatic openssh build?

MaxPeal avatar Apr 08 '22 16:04 MaxPeal

I have just learned that modern releases of openssh have deprecated the scp protocol. When using dropbear as server and an openssh client, legacy scp can be reenabled using the -O flag. But, as the article states the legacy protocol may be completely disabled at some point in the future.

So folks using dropbear as SSH server will need a solution to support sftp for secure file transfer in the future.

thom-nic avatar Jun 28 '22 17:06 thom-nic

Not sure if it makes sense to bundle those, since Dropbear and the OpenSSH SFTP server are two entirely dedicated standalone projects which can be plug&play combined trivially by end users? If I'm not mistaken, the only thing that needs to exist on Linux distros is /usr/lib/sftp-server, which is then invoked by clients automatically server-side. And one might want to use alternatives like the Green End SFTP Server. Having separate executables and the ability to e.g. update each separately also is a security aspect.

MichaIng avatar Nov 20 '22 13:11 MichaIng

Not sure if it makes sense to bundle those, since Dropbear and the OpenSSH SFTP server are two entirely dedicated standalone projects which can be plug&play combined trivially by end users? If I'm not mistaken, the only thing that needs to exist on Linux distros is /usr/lib/sftp-server, which is then invoked by clients automatically server-side. And one might want to use alternatives like the Green End SFTP Server. Having separate executables and the ability to e.g. update each separately also is a security aspect.

I tried to compile Openssh sftp-server, but it cannot be called by Dropbear subsystem. Is there any relevant information about transplanting sftp-server?

dadolee avatar Dec 07 '22 09:12 dadolee

As said, it works here OOTB with any SFTP server binary located at /usr/lib/sftp-server or /usr/lib/openssh/sftp-server, or anywhere else if the SFTP client allows to define the path. Assure that the binary is executable. Otherwise, some more details, especially what exactly you did, error messages etc would be helpful. But at best in a dedicated issue, to not mess with this feature request.

MichaIng avatar Dec 07 '22 11:12 MichaIng

Well I have an integrated small scp integrated in dropbear which does the -f -t -p options and integrates in svr-chansession.c it is only 7,5 kb source, if there is an interest in that I will post that. That way you don't have to rely on an external scp binary or sftp binary. But it is very basic...

HansH111 avatar Jan 22 '23 16:01 HansH111

Not sure if it makes sense to bundle those, since Dropbear and the OpenSSH SFTP server are two entirely dedicated standalone projects which can be plug&play combined trivially by end users? If I'm not mistaken, the only thing that needs to exist on Linux distros is /usr/lib/sftp-server, which is then invoked by clients automatically server-side. And one might want to use alternatives like the Green End SFTP Server. Having separate executables and the ability to e.g. update each separately also is a security aspect.

I tried to compile Openssh sftp-server, but it cannot be called by Dropbear subsystem. Is there any relevant information about transplanting sftp-server?

I was able to simple compile sftp-server from the project openssh-portable with

 ./configure --without-openssl --host arm-linux --without-zlib --with-ldflags=-static && make sftp-server

just change to host to your need. And move the binary next to the dropbear or somewhere in the PATH. It should work. I ended up with the dropbearmulti arm 32bit binary 500kb and the sftp-server on itself 600+ kb . It's works like a charm

takov751 avatar Feb 03 '23 03:02 takov751

i managed to use the openssh sftp server in dd-wrt with dropbear and its just 22 kb on mips platform

BrainSlayer avatar Feb 17 '23 10:02 BrainSlayer