Revision as of 12:28, 4 July 2015 by Craig Peacock (Talk | contribs)

SFTP-Server

If you have installed the DropBear SSH Server and now need to transfer files using SFTP (Secure File Transfer Protocol), the SFTP-server as part of OpenSSH is a good choice.

zlib Data Compression Library

sftp-server requires zlib. Download, cross compile and install the zlib compression libraries. Configure doesn't accept the --host parameter (reports unknown option), so you need to hack the makefile.

wget http://zlib.net/zlib-1.2.8.tar.gz
tar -xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure --prefix=/home/export/rootfs

Edit the makefile and prefix the build tools with arm-none-linux-gnueabi-.

CC=arm-linux-gnueabi-gcc
LDSHARED=arm-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
CPP=arm-linux-gnueabi-gcc -E
AR=arm-linux-gnueabi-ar
RANLIB=arm-linux-gnueabi-ranlib

Make and install:

make
make install

OpenSSH sftp-server

Download and build the sftp-server component of OpenSSH:

wget http://mirror.internode.on.net/pub/OpenBSD/OpenSSH/portable/openssh-6.9p1.tar.gz
tar -xzf openssh-6.9p1.tar.gz
cd openssh-6.9p1
./configure --prefix= --host=arm-linux-gnueabi --sysconfdir=/etc --with-zlib=/home/export/rootfs
make sftp-server

Now copy sftp-server to /usr/libexec/ on your target system.