Future need ftp service to upload and download data applications embedded Linux system through, so you need to be ready vsftpd transplants. This work is done in Ubuntu virtual machine.
download
Download vsftpd-3.0.3.tar.gz: https: //security.appspot.com/vsftpd.html#download
copied to the Ubuntu virtual machine working folder <WORK> / vsftpd
Decompression
$ cd <WORK>/vsftpd
$ tar xzf vsftpd-3.0.3.tar.gz
$ cd vsftpd-3.0.3/
Configuration
Open the Makefile, modify the value of CC (cross compiler tools) and LIBS variables and saved as follows:
CC = arm-xilinx-linux-gnueabi-gcc
LIBS = `./vsf_findlibs.sh` -lcrypt
PATH path compiler needs to be set in advance, such as:
$ export PATH=$PATH:<WORK>/Toolchain/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin
Compile
$ make # 编译,如果电脑是多核CPU,如四核,使用make -j4可提高编译速度
Compilation is complete, the current directory will generate two files vsftpd and vsftpd.conf, these two documents is that we want to use
copy
Follow-up needs to be generated to move vsftpd rootfs / usr / sbin directory, vsftpd.conf copied to the rootfs / etc directory now be copied to a temporary folder
$ sudo cp vsftpd <WORK>/tmp/ # 复制执行文件到目标板
$ sudo cp vsftpd.conf <WORK>/tmp/ # 复制配置文件到目标板
Configuration
Open the file with gedit vsftpd.conf configuration, the following configuration can achieve normal anonymous users upload and download function, subsequent function to add the specified user:
# The following modifications
anonymous_enable = YES # Allow anonymous users
local_enable = YES # Local access
write_enable = YES # editable
local_umask = 022 # create the file permissions
= YES anon_upload_enable # allow anonymous users to upload
File anon_mkdir_write_enable = YES # Folders can be created and modified within the folder
dirmessage_enable = YES # activate directory message
xferlog_enable = YES // activate the upload / download log
connect_from_port_20 = YES # transport connection from port 20
xferlog_std_format = YES # using standard ftpd xferlog log file format
listen = YES # Enable monitor
# Add below
listen_port=21
#pam_service_name=vsftpd
no_anon_password=YES
local_root=/
anon_root=/home/ftp
anon_world_readable_only=YES
tcp_wrappers=NO
Competence
The vsftpd modify executable permissions:
$ sudo chmod +x <WORK>/Filesystem/tmp # 添加可执行权
Modify vsftpd vsftpd.conf and file permissions, user profiles permission to users and groups are changed to root, access to reading and writing
Preparations complete