Raspberry Pi uses FTP to build a file server tutorial

In addition to SAMBA, there is an FTP server for sharing files in the LAN

The FTP server we choose here is VSFTP

vsftpd is a GPL-based FTP server software used on UNIX-like operating systems. Its full name is "very secure FTP". From the name, it can be seen that high security is its characteristic, except for its high speed and stability. It is also an important feature.

1. Install vsftpd

sudo apt-get update

sudo apt-get install vsftpd

2. Modify the configuration /etc/vsftpd.conf

sudo nano /etc/vsftpd.conf

Modify the configuration file as shown below (the simplest configuration)

anonymous_enable=NO     匿名帐号 

local_enable=YES        本地帐号

write_enable=YES       允许使用任何可以修改文件系统的FTP的指令

local_umask=022        屏蔽权限即本地用户上传的文件权限

anon_upload_enable=NO     允许匿名用户上传文件

anon_mkdir_write_enable=NO  允许匿名用户创建新目录

dirmessage_enable=YES     允许为目录配置显示信息    

ascii_upload_enable=YES     管控是否可用ASCII 模式上传

ascii_download_enable=YES    管控是否可用ASCII 模式下载

img
img
img
Save and exit after modification (ctrl x)

More detailed configuration

anonymous_enable=YES 是否允许匿名帐号
local_enable=YES  是否允许本地帐号
write_enable=YES  是否允许使用任何可以修改文件系统的FTP的指令
local_umask=022 本用户的文件掩码
anon_upload_enable=YES是否允许匿名用户上传文件
anon_mkdir_write_enable=YES是否允许匿名用户创建新目录
dirmessage_enable=YES 是否显示欢迎信息
xferlog_enable=YES 开启日记功能
connect_from_port_20=YES 设定ftp服务数据端口
chown_uploads=YES是否允许修改上传文件的属主
chown_username=whoever如果允许,输入该属主的用户名
xferlog_file=/var/log/xferlog日志文件位置
xferlog_std_format=YES 使用标准的日志格式
idle_session_timeout=600空闲连接超时
data_connection_timeout=120数据传输超时
nopriv_user=ftpsecure当服务器运行于最底层时使用的用户名
async_abor_enable=YES是否允许使用\"async ABOR\"命令,一般不用,容易出问题
ascii_upload_enable=YES是否可用ASCII 模式上传。默认值为NO
ascii_download_enable=YES是否可用ASCII 模式下载。默认值为NO
ftpd_banner=Welcome to blah FTP service   login时显示欢迎信息
deny_email_enable=YES如果匿名用户需要密码,那么使用banned_email_file里面的电子邮件地址的用户不能登录
banned_email_file=/etc/vsftpd/banned_emails禁止使用匿名用户登陆时作为密码的电子邮件地址
chroot_list_enable=YES如果启动这项功能,则所有列在chroot_list_file中的使用者不能更改根目录
chroot_list_file=/etc/vsftpd/chroot_list定义不能更改用户主目录的文件
userlist_enable=YES 若启用此选项,userlist_deny选项才被启动

3. Create ftp home directory and start

sudo –pv ~/ftp

sudo /etc/init.d/vsftpd start

4. Download Xftp software on the computer

Create a new session.
img
Name your own name
. Fill in the Raspberry Pi IP
port number at the host . 21
User name is Raspberry Pi. The default user name is pi. The
password is Raspberry Pi. The default password is raspberry
.
img

Guess you like

Origin blog.csdn.net/qq_41676577/article/details/112856592