Skip to main content

Porting vsftpd to ARM: Cross-Compile and Deployment Guide

·454 words·3 mins
ARM Vsftpd Buildroot Embedded Linux
Table of Contents

πŸ“– Overview
#

This guide walks through how to cross-compile and deploy vsftpd (Very Secure FTP Daemon) on an ARM-based development board.

It covers:

  • Toolchain configuration
  • Compilation process
  • Deployment and setup
  • Service management and testing

πŸ› οΈ Environment Setup
#

Before starting, ensure the following environment is ready:

  • SDK: Fudan Micro (FM)
  • Build System: Buildroot 2018.02.3
  • Source Package: vsftpd-3.0.2.tar.gz

πŸ“¦ Source Preparation
#

Create a workspace and extract the source code:

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/

This prepares the source tree for cross-compilation.


βš™οΈ Toolchain Configuration
#

Edit the Makefile to use the correct ARM cross-compiler.

Locate and update the CC variable:

# Set your cross-compiler
CC = arm-linux-gnueabihf-gcc

Make sure:

  • The toolchain is installed
  • The compiler is available in your PATH

πŸ§ͺ Compilation
#

Build the vsftpd binary using:

make

Expected output:

  • vsftpd β†’ executable binary
  • vsftpd.conf β†’ default configuration file

If compilation fails:

  • Verify toolchain path
  • Check missing dependencies
  • Ensure Buildroot environment is properly configured

πŸš€ Deployment to ARM Board
#

Transfer the compiled files to the target system:

  • Copy vsftpd β†’ /usr/sbin/
  • Copy vsftpd.conf β†’ /etc/

Set execution permissions:

chmod +x /usr/sbin/vsftpd

πŸ‘€ User and Configuration Setup
#

Create FTP User
#

adduser ftp

Set a password when prompted.


Configure vsftpd
#

Edit /etc/vsftpd.conf:

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
listen=YES
ftp_username=ftp
secure_chroot_dir=/mnt/

Key Options Explained
#

  • anonymous_enable: Enables anonymous login
  • local_enable: Allows local users
  • write_enable: Enables uploads/deletions
  • secure_chroot_dir: Defines sandbox directory

▢️ Running the Service
#

Manual Start
#

/usr/sbin/vsftpd &

Auto-Start Configuration
#

Create init script:

/etc/init.d/S70vsftpd

Script content:

#! /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)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
esac
exit 0

Make it executable:

chmod +x /etc/init.d/S70vsftpd

Control the service:

/etc/init.d/S70vsftpd restart

🌐 Client Testing
#

Test FTP connectivity from a PC:

ftp 192.168.31.45

Example session:

220 Welcome to FTP service.
User: ftp
Password: ******
230 Login successful.

ftp> ls
ftp> get file.txt
ftp> put upload.txt
ftp> quit

⚠️ Common Issues
#

  • Permission denied β†’ Check file permissions and user rights
  • Connection refused β†’ Ensure vsftpd is running and port is open
  • Login failure β†’ Verify configuration and user credentials
  • Chroot errors β†’ Ensure secure_chroot_dir exists and is accessible

🧾 Summary
#

  • Cross-compile vsftpd using ARM toolchain
  • Deploy binary and configuration to target system
  • Configure users and FTP settings
  • Enable manual or automatic service startup
  • Validate functionality via FTP client

This setup transforms an ARM development board into a lightweight and reliable FTP server, suitable for embedded systems and file transfer workflows.

Related

NVIDIA N1/N1X ARM Chips Target High-End AI PCs
·504 words·3 mins
NVIDIA ARM Windows on ARM AI PC Laptop SoC
Arm’s Chiplet Strategy: Building a Scalable Multi-Die Ecosystem
·695 words·4 mins
ARM Chiplet
Building an ARM-Based VxWorks RTOS on AT91RM9200
·799 words·4 mins
VxWorks ARM Embedded Systems RTOS Industrial Control