Operations 15 min read

How to Cross‑Compile and Deploy vsftpd on an ARM Board

This guide walks you through extracting the vsftpd source, configuring the ARM cross‑toolchain, compiling the server, copying binaries and configuration files to the target board, creating a startup script, and testing the FTP service from a PC client.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Cross‑Compile and Deploy vsftpd on an ARM Board

Many SDKs do not include an FTP server, so developers often need to port one themselves. This article provides a step‑by‑step guide for porting the vsftpd 3.0.2 FTP server to an ARM board using the Fudan Micro SDK and Buildroot 2018.02.3.

Environment

sdk: Fudan Micro
Buildroot 2018.02.3

1. Extract the source

$ mkdir ~/vsftpd
$ cp vsftpd-3.0.2.tar.gz ~/vsftpd
$ cd ~/vsftpd
$ tar xzf vsftpd-3.0.2.tar.gz
$ cd vsftpd-3.0.2/

2. Configure the toolchain

Edit the Makefile to use the appropriate cross‑compiler:

CC = arm-linux-gnueabihf-gcc
Replace the compiler with the one matching your target platform.

3. Build the server

Run make to compile all source files with the cross‑compiler. The command produces a large list of compilation lines and finally links the binary:

peng@ubuntu:~/vsftpd/vsftpd-3.0.2$ make
... (compilation output) ...
arm-linux-gnueabihf-gcc -o vsftpd ... -Wl,-s -pie -Wl,-z,relro -Wl,-z,now `./vsf_findlibs.sh`

After the build finishes, two files appear in the directory: vsftpd (the executable) and vsftpd.conf (the default configuration).

4. Copy files to the target board

Copy the executable to /usr/sbin on the board.

Copy vsftpd.conf to /etc on the board.

Make the executable runnable:

chmod +x /usr/sbin/vsftpd

5. Configure vsftpd

Create a local FTP user and set its password:

$ adduser ftp
Changing password for root
New password:
Retype password:
Password for ftpadmin changed by root

Edit /etc/vsftpd.conf (or the copied config file) and enable the most common options, for example:

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
file_open_mode=0777
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
listen=YES
ftpd_banner=Welcome to 6902 FTP service.
ftp_username=ftp
secure_chroot_dir=/mnt/

6. Start the server

Run the daemon in the background on the board: # /usr/sbin/vsftpd & The trailing & puts the process into the background.

7. Enable autostart

Create an init script S70vsftpd and place it in /etc/init.d:

#! /bin/sh
set -e
DESC="vsftpd"
NAME=vsftpd
DAEMON=/usr/sbin/$NAME
case "$1" in
  start)
    printf "Starting $DESC: "
    start-stop-daemon -S -b -x $NAME
    echo "OK"
    ;;
  stop)
    printf "Stopping $DESC: "
    start-stop-daemon -K -x $NAME
    echo "OK"
    ;;
  restart|force-reload)
    echo "Restarting $DESC: "
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
esac
exit 0

Enable it with:

/etc/init.d/S70vsftpd restart

8. Test from a client

From a Windows PC, connect with the built‑in FTP client:

C:\>ftp
ftp> open 192.168.31.45
User (192.168.31.45:(none)): root
Password:
230 Login successful.
ftp> ls
... (directory listing) ...
ftp> get 123
... (file download) ...
ftp> quit
221 Goodbye.

Following these steps yields a functional FTP service on the ARM board, ready for file transfer and further integration.

ARMcross-compilationvsftpdEmbedded Linuxinit scriptFTP server
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.