Linux FTP file transfer service

FTP service overview

The protocol used to transfer files The
FTP server uses TCP port 20 and 21 to communicate with the client by default. Port
20 is used to establish a data connection and transfer file data.
Port 21 is used to establish a control connection and transfer FTP control commands.

FTP data connection mode

Active mode: The server actively initiates a data connection
Passive mode: The server passively waits for a data connection

experiment

Experimental environment: a LINUX virtual machine, a WIN10 virtual machine

Settings in Linux

yum install -y vsftpd
cd /etc/vsftpd/
cp vsftpd.conf vsftpd.conf.bak #做个备份
或者cp vsftpd.conf{,.bak}

Insert picture description here
Insert picture description here
Set the maximum permissions of the FTP service accessed by anonymous users

#修改配置文件
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES            #开启匿名用户访问。默认已开启
write_enable=YES                #开放服务器的写权限(若要上传,必须开启)。默认已开启
anon_umask=022                  #设置匿名用户所上传数据的权限掩码(反掩码)。默认已开启
anon_upload_enable=YES          #允许匿名用户上传文件。默认已注释,需取消注释
anon_mkdir_write_enable=YES     #允许匿名用户创建(上传)目录。默认已注释,需取消注释
anon_other_write_enable =YES    #允许删除、重命名、覆盖等操作。需添加

#开启服务,关闭防火墙和增强型安全功能
systemctl start vsftpd
systemctl stop firewalld
setenforce 0

Insert picture description here
Insert picture description here
Configuration in Windows

#匿名访问测试
在Windows系统打开 开始 菜单,输入 cmd 命令打开命令提示符
#建立ftp连接
ftp 192.168.12.10
#匿名访问,用户名为ftp,密码为空,直接回车即可完成登录
ftp> pwd			#匿名访问ftp的根目录为Linux系统的/var/ftp/目录
ftp> ls				#查看当前目录
ftp> cd pub			#切换到pub 目录
ftp> get 文件名		#下载文件到当前Windows本地目录  
ftp> put 文件名		#上传文件到ftp目录
ftp> quit			#退出

Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/MQ107/article/details/114686266