1、交叉编译vstftp
下载vsftpd源码:vsftpd-3.0.2.tar.gz
# tar –xzvf vsftpd-3.0.2.tar.gz
# cd vsftpd-3.0.2
修改makefile文件:
CC = arm-linux-gnueabihf-gcc
# make
将vsftpd文件放到/usr/bin/,将vsftpd.conf文件放到/etc/
2、开发板上部署vsftpd
修改vsftpd.conf文件如下:
anonymous_enable=NO
local_enable=YES
write_enable=YES
file_open_mode=0777
anon_umask=0000
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
connect_from_port_20=YES
ftpd_banner=Welcome to LSDDM-AMR1808-B4 FTP service.
listen=YES
secure_chroot_dir=/opt/usr/share/empty
pam_service_name=vsftpd
ftp_username=ftp
local_root=/ftp
创建/opt/usr/share/empty目录:
# mkdir /opt/usr/share/empty
创建ftp账号,密码为root
# adduser ftp
3、开发板上启动vsftpd
# ifconfig eth0 up
# ifconfig eth0 192.168.1.11 netmask 255.255.255.0 broadcast 192.168.1.255
# /usr/bin/vsftpd &
4、PC端使用FileZilla登录FTP