What is FTP?
FTP, File Transfer Protocol, can be implemented on the network to transmit a variety of types of files
A full FTP file transfer requires establishing two types of connections, first establishing a control connection, and then establishing a data connection
Control connection: The client first initiates a connection request to the TCP21 port on the server, receives the request, and completes the establishment of the control connection.
Data connection: After a control connection is established, a data connection is started to be used to transfer files. The data connection has active transfer mode and passive transfer mode.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/77/wKioL1e_uY_gKWSwAACsFyB5R9Q642.png "title=" FTP active mode. png "width=" 610 "height=" 290 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:610px;height:290px; "alt=" wkiol1e _uy_gkwswaacsfyb5r9q642.png "/>
Active transfer Mode diagram
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/86/77/wKiom1e_uezB0TfZAADfuruUODw525.png "title=" FTP passive mode. png "width=" 610 "height=" 286 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:610px;height:286px; "alt=" wkiom1e _uezb0tfzaadfuruuodw525.png "/>
Passive transfer Mode diagram
Advantages and disadvantages of active and passive transmissions:
1, the active transfer to the FTP server management is advantageous, but unfavorable to the client, because the client's firewall may prohibit the service side to the client high port connection request, causes the connection to fail;
2, passive transmission is beneficial to FTP client, but bad for server, because the server firewall may prohibit the client to the service segment high port connection request, causes the connection to fail
After the control connection and the data connection have been established, the data transfer can begin, and the FTP transmits it in ASCII and binary two ways.
Binary does not handle the data in any way.
The ASCII method converts the carriage return line to the return character of the native.
Using binary to guarantee the integrity of data transmission
ASCII is typically used for Windows transfer files to the Linux/unix system, because the Windows and UNIX systems have different line endings, and when using binary transfer, the end of the file file on the UNIX system is opened with a ^m symbol. The use of ASCII transmission does not
VSFTPD Server Installation and configuration
1. Install the VSFTPD package
Yum Install-y vsftpd
2. Modify the configuration file/etc/vsftpd/vsftpd.conf
anonymous_enable=yes #设置是否允许匿名用户登录local_enable =yes #设置是否允许本地用户登录local_root =/home #设置本地用户的根目录write_ enable=yes #是否允许用户有写权限local_umask =022 #设置本地用户创建文件时的umask值anon_upload_enable =yes #设置是否允许匿名用户上传文件anon_ other_write_enable=yes #设置匿名用户是否有修改的权限anon_world_readable_only =yes #当为YES时, other people in the file must have Read permission to allow anonymous users to download, only FTP and Read permissions are not downloaded, must be read by others to allow download download_enbale=yes #是否允许下载chown_upload =yes #设置匿名用户上传文件后修改文件的所有者chown_ username=ftpuser #与上面选项连用, indicating that the modified owner is ftpuserascii_upload_enable=yes #设置是否允许使用ASCII模式上传文件ascii_download_enable =yes #设置是否允许用ASCII模式下载文件chroot_local_ user=yes #设置是否锁定本地用户在自己的主目录中, (cannot CD to parent directory or sibling directory after login) chroot_list_enable=yes #设置是否将用户锁定在自己的主目录中chroot_list_file =/etc/vsftpd/chroot_list # Define which users will be locked in their home directory userlist_enable=yes #当为YES时表示由userlist_file文件中指定的用户才能登录ftp服务器userlist _file=/etc/vsftpd/user_list #当userlist_enable为YES时才生效
(By default, the directory in which the anonymous user is logged in is under the/var/ftp of the server)
3. Start VSFTPD Service
Service FTPD Start
This article is from the "a" blog, please make sure to keep this source http://lzs66.blog.51cto.com/9607068/1842997
FTP protocol details and installation configuration of VSFTPD on Linux