当前位置:网站首页>FTP service
FTP service
2022-07-22 12:09:00 【Free to Superman】
Catalog
FTP Function and working principle
FTP summary
FTP(File TransferProtocol, File transfer protocol ) Is a typical C/S Application layer protocol of architecture , The server software is required 、 The two parts of the client software jointly realize the file transfer function .FTP The connection between the client and the server is reliable , Connection oriented , It provides reliable guarantee for data transmission .
TCP agreement :20,21 port
20 port : For data transfer
21 port : Used to transmit instructions ( Establishing a connection )
FTP It's a file transfer protocol , It supports two modes , One way is called Standard( That is to say Active, Active way ), One is Passive( That is to say PASV Passive way ).
Standard Pattern FTP The client sends PORT Order to FTP server.Passive Pattern FTP The client sends PASV Order to FTP Server
FTP Function and working principle
FTP The role of :
Internet The protocol used to transfer files remotely on .
FTP The pattern of :
vsftp Full name (very secure FTP)
vsftp Pattern :c/s Pattern
FTP The server defaults to TCP Agreed 20、21 Port to communicate with the client :
20 Ports are used to establish data connections , And transfer file data
21 Ports are used to establish control connections , And transmit FTP Control command
FTP Working principle and process
FTP Data connection is divided into active mode and passive mode
Active mode : The server initiates the data connection actively
Passive mode : The server passively waits for data connections
experiment
First, turn off the firewall
install vsftpd
open ftp service
Then enter vsftpd take vsftpd.conf File backup
then vim /etc/vsftpd/vsftpd.conf Compiling
write in :
anon_upload_enable=YES: Allow anonymous users to upload files
anon_mkdir_write_enable=YES: Allow anonymous users to create ( Upload ) Catalog
anon_other_write_enable=YES: Allow deletion of , rename , Covering and other operations
And guarantee anonymous_enable=YES: Enable anonymous access ( Default on )
write_enable=YES: Open server write permissions ( Default on )
local_umask=022: Set the permission mask for anonymous users to upload data
Access is anonymous ftp Under the root directory of pub Set the maximum permissions for subdirectories So that anonymous users can upload data , And then restart ftp service
Get into /var/ftp/pub Create a new file 1.txt
open windows, Open command window , Connect to ftp 192.168.200.111( virtual machine ip Address )
Input password , Then enter pub Catalog , Check for 1.txt, then get 1.txt Download the file locally
Enter the folder to check , Create a new 2.txt, And write content
Then enter in the command window put 2.txt, Get the file back to the virtual machine
Enter the virtual machine to view pub Catalog , And look at the content , success
Set user mode login
Set up local user authentication access ftp, And prohibit switching to ftp Outside directory ( The default login root directory is the home directory of the local user )
vim /etc/vsftpd/vsftpd.conf
local_enable=YES # Enable local users
anonymous_enable=NO # Turn off anonymous user access
write_enable=YES # Open server write permissions ( To upload, you must enable )
local_umask=077 # It can be set that only the user of the host directory has the permission to upload files ( Unmask )
chroot_local_user=YES # Lock access to the user's Host Directory
allow_writeable_chroot=YES # Allow restricted users to have write permission under their home directory
#anon_mkdir_write_enable=YES notes
#anon_other_write_enable=YES notes
systemctl restart vsftpd # Restart the service
Create a new user fang, And give authority , Set the host directory
Get into windows, Connect ftp, Sign in fang user , And get it back 1.txt and 2.txt
Get into fang Host Directory view , success
边栏推荐
- Performance optimization strategy of 5g network multi random access mechanism for mmtc
- 30.【静态数据成员】
- 【oops-framework】时间管理
- 鼠标行为HHT变换的工业互联网用户身份认证
- Legend setup tutorial GOM engine micro terminal setting method
- 师傅教你~LNMP源码搭建
- 一种基于全相位FFT幅值的频率补偿方法
- 传奇架设教程GOM引擎微端设置方法
- An access scheme based on dynamic allocation of random access opportunity
- LeetCode:814. 二叉树剪枝【递归】
猜你喜欢
The evolution history of the background platform transformation of flybook management after the introduction of cloudwego
31. [memcpy function and strcpy function]
Morphology of machine learning foundation (5)
音视频(三)—深挖基础
Flutter实战-自定义键盘(三)
布隆过滤器与布谷鸟过滤器(经典版)
How does redis like and cancel? (glory Collection Edition)
SCA在得物DevSecOps平台上应用
第02篇:分布式负载均衡
FPGA - SPI bus control flash (1) (including code)
随机推荐
Jmeter-测试脚本学习(登录脚本)
Pyqt5 makes an exquisite video player * with source code
User identity authentication of industrial Internet based on HHT transformation of mouse behavior
Master teaches you how to build LNMP source code
30.【静态数据成员】
[英雄星球七月集训LeetCode解题日报] 第21日 堆
Jmeter进阶之性能测试响应结果保存到本地
Interface document evolution atlas, some ancient interface document tools, you may not have used them
元宇宙浪潮震撼来袭,抓住时机,齐心协力
Advantages of vr virtual simulation teaching software for cable fault monitoring
Morphology of machine learning foundation (5)
传奇手游开服教程:传奇手游战神引擎架设教程
Meta's latest image generation tool is popular, and it can actually draw dreams into reality!
Legend setup tutorial GOM engine micro terminal setting method
Oracle 创建高级连接
CDH5、CDH6部署指南(稳)
Go language concurrency and channel
Application of 3D simulation and visual display in industrial plant
IP第十二天笔记
基于FPGA-Jetson的智能电网硬件实时联合仿真