π 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 binaryvsftpd.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 loginlocal_enable: Allows local userswrite_enable: Enables uploads/deletionssecure_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_direxists 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.