1.FTPis file Transfer Protocol (File Transfer Protocolenglish abbreviation, and Chinese Jane is called "the Interfax agreement". For use on the InternetControl Filestwo-way transmission. At the same time, it is also aApplication(application). There are different FTP applications based on different operating systems, and all of these applications follow the same protocol to transfer files. In the use of FTP, users often encounter two concepts: "Download" (Download) and "Upload" (Upload). A "Download" file is a copy of a file from a remote host to its own computer; the "upload" file is a copy of the file from your computer to a remote host. In the Internet language, users can upload (download) files to (from) a remote host through a client program.
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9D/BA/wKiom1mEgxDieN7YAActLLtn5TA620.png "title=" Screenshot from 2017-08-04 22-21-42.png "alt=" Wkiom1megxdien7yaactlltn5ta620.png "/>
2. Install FTP
(1) Configure IP address
Hostnamectl Set-hostname ftp_server.example.com
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/BA/wKioL1mEhBnjLAmYAABBuxDfhpA602.png "title=" Screenshot from 2017-08-04 09-16-44.png "alt=" Wkiol1mehbnjlamyaabbuxdfhpa602.png "/>
(2) Yum install vsftpd-y installation Service
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/BA/wKioL1mEg7ezhRtCAABMwTHv43U748.png "style=" float : none; "title=" screenshot from 2017-08-04 09-17-17.png "alt=" Wkiol1meg7ezhrtcaabmwthv43u748.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/BA/wKiom1mEg7iQgrolAABOV3tqpms760.png "style=" float : none; "title=" screenshot from 2017-08-04 09-17-35.png "alt=" Wkiom1meg7iqgrolaabov3tqpms760.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/BA/wKiom1mEhKLw-FwzAAAeD8eCsg8060.png "title=" Screenshot from 2017-08-04 09-40-15.png "alt=" Wkiom1mehklw-fwzaaaed8ecsg8060.png "/>
(3) systemctl start VSFTPD Service
Systemctl Enable VSFTPD boot automatically
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/BA/wKiom1mEhTGz30oDAABjhezy5cE839.png "title=" Screenshot from 2017-08-04 09-49-16.png "alt=" Wkiom1mehtgz30odaabjhezy5ce839.png "/>
(4) Systemctl Stop FIREWALLD setting firewall allows FTP to pass
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/BA/wKiom1mEhWaSjGQnAAFF8H33mos197.png "style=" float : none; "title=" screenshot from 2017-08-04 09-49-35.png "alt=" Wkiom1mehwasjgqnaaff8h33mos197.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9D/BA/wKioL1mEhWeybszoAABZcHlgvpY195.png "style=" float : none; "title=" screenshot from 2017-08-04 09-49-51.png "alt=" Wkiol1mehweybszoaabzchlgvpy195.png "/>
Or use the graphical interface
Firewall-config
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C5/wKioL1mFsj-RkGYDAADsvCLTRyY878.png "title=" Screenshot from 2017-08-05 19-52-34.png "alt=" Wkiol1mfsj-rkgydaadsvcltryy878.png "/>
Select Permanent,ftp, click Options,reload Finish to allow FTP to pass
(5) Setenforce 0 off SELinux, since SELinux changes the configuration file, it needs to reload the kernel
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/BA/wKiom1mEg9yDGkdnAAAbYQmI1BM942.png "title=" Screenshot from 2017-08-04 09-17-58.png "alt=" Wkiom1meg9ydgkdnaaabyqmi1bm942.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/BA/wKioL1mEg07h7v7UAADMCaPTO_0644.png "title=" Screenshot from 2017-08-04 09-16-31.png "alt=" Wkiol1meg07h7v7uaadmcapto_0644.png "/>
(6) Reboot
(7) Lftp 172.25.254.128 can login and display, indicating installation success
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/BA/wKiom1mEhemALmqpAAA6L_wzjGY993.png "title=" Screenshot from 2017-08-04 09-50-04.png "alt=" Wkiom1mehemalmqpaaa6l_wzjgy993.png "/>
3.VSFTPD File Information
/var/ftp/pub Default Publishing Directory Pub
/etc/vsftpd.conf Configuration Directory
Configuration parameters for 4.VSFTPD services
(1) Anonymous user settings
Anonymous User Login Restrictions
Anonymous_enable=no | YES
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C0/wKiom1mFTzLSVTC8AAAuD13LH4g307.png "style=" float : none; "title=" screenshot from 2017-08-04 09-58-45.png "alt=" Wkiom1mftzlsvtc8aaaud13lh4g307.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/BF/wKioL1mFTzOT03nzAAAykLiG7CA104.png "style=" float : none; "title=" screenshot from 2017-08-04 09-59-19.png "alt=" Wkiol1mftzot03nzaaayklig7ca104.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/C0/wKiom1mFTzORSuopAAAxpPJgpgM703.png "style=" float : none; "title=" screenshot from 2017-08-04 10-00-08.png "alt=" Wkiom1mftzorsuopaaaxppjgpgm703.png "/>
Anonymous user uploads
Vim/etc/vsftpd/vsftpd.conf
Anon_upload_enable=yes
Chgrp ftp/var/ftp/pub
chmod 775/var/ftp/pub
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/C0/wKioL1mFT-jAD8WSAABSo5HWSvs451.png "title=" Screenshot from 2017-08-04 10-27-16.png "alt=" Wkiol1mft-jad8wsaabso5hwsvs451.png "/>
Anonymous user Download
Anon_world_readable_only=yes|no setting parameter value NO means that anonymous users can download
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/C4/wKiom1mFj7aiuh5tAAAP-xFLpT8141.png "style=" float : none; "title=" screenshot from 2017-08-05 17-25-53.png "alt=" Wkiom1mfj7aiuh5taaap-xflpt8141.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/C4/wKiom1mFj7Ww1DugAACeAGCtpbA413.png "style=" float : none; "title=" screenshot from 2017-08-05 17-23-48.png "alt=" Wkiom1mfj7ww1dugaaceagctpba413.png "/>
Anonymous user Delete
Anon_other_write_enable=yes|no
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/C0/wKioL1mFUQuw3_lUAAAehlTkie0145.png "title=" Screenshot from 2017-08-04 11-04-42.png "alt=" Wkiol1mfuquw3_luaaaehltkie0145.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/C0/wKiom1mFUSDC4WM0AADPP_Urunc854.png "title=" Screenshot from 2017-08-04 11-04-14.png "alt=" Wkiom1mfusdc4wm0aadpp_urunc854.png "/>
Create directory for anonymous users
Anon_mkdir_write_enable=yes|no
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C0/wKioL1mFUXLAB0o1AAAWsMV13pI331.png "style=" float : none; "title=" screenshot from 2017-08-04 11-05-15.png "alt=" Wkiol1mfuxlab0o1aaawsmv13pi331.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/C0/wKiom1mFUXPwkiIzAABB1QChP6U217.png "style=" float : none; "title=" screenshot from 2017-08-04 11-06-39.png "alt=" Wkiom1mfuxpwkiizaabb1qchp6u217.png "/>
Anonymous User home Directory modification
Anon_root=/direcotry
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/C0/wKiom1mFUenRDKNyAAAeH1AJGK0748.png "style=" float : none; "title=" screenshot from 2017-08-05 10-09-47.png "alt=" Wkiom1mfuenrdknyaaaeh1ajgk0748.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/C0/wKiom1mFUerirb-MAACzbFbgpkQ234.png "style=" float : none; "title=" screenshot from 2017-08-05 10-25-38.png "alt=" Wkiom1mfuerirb-maaczbfbgpkq234.png "/>
Anonymous user upload file default permission modification
Anon_umask=xxx
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C0/wKioL1mFUhrgT4dhAAAPoSyG4HU915.png "style=" float : none; "title=" screenshot from 2017-08-05 10-48-20.png "alt=" Wkiol1mfuhrgt4dhaaaposyg4hu915.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/C0/wKiom1mFUhuDLAGuAACRB5o7CKM362.png "style=" float : none; "title=" screenshot from 2017-08-05 11-07-46.png "alt=" Wkiom1mfuhudlaguaacrb5o7ckm362.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/C0/wKiom1mFUhzSodTOAACfK5OuBH8505.png "style=" float : none; "title=" screenshot from 2017-08-05 11-11-55.png "alt=" Wkiom1mfuhzsodtoaacfk5oubh8505.png "/>
User identity modifications used by anonymous users
Chown_uploads=yes
Chown_username=student
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C0/wKiom1mFUkeTsAu2AAAuFkD0JQw320.png "style=" float : none; "title=" screenshot from 2017-08-05 11-17-11.png "alt=" Wkiom1mfuketsau2aaaufkd0jqw320.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/C0/wKioL1mFUkjwRpkmAADRYjoNq68348.png "style=" float : none; "title=" screenshot from 2017-08-05 11-18-32.png "alt=" Wkiol1mfukjwrpkmaadryjonq68348.png "/>
Max upload Rate
Anon_max_rate=102400 (in kilobytes (KB) for maximum transfer speed 100M)
Maximum number of links
Max_clients=2 (indicates up to 2 hosts connected)
(2) Local user settings
Local User Login Restrictions
Local_enable=yes|no
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/C0/wKiom1mFVE2TX3P_AAA1CRs_t-k359.png "title=" Screenshot from 2017-08-04 10-04-25.png "alt=" Wkiom1mfve2tx3p_aaa1crs_t-k359.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/C0/wKioL1mFVC7BkeRHAABvjk1HvHI424.png "style=" float : none; "title=" screenshot from 2017-08-04 10-06-20.png "alt=" Wkiol1mfvc7bkerhaabvjk1hvhi424.png "/>
Write_enable=yes|no Local User Write permission limit, if off, local anonymous cannot write
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C0/wKiom1mFVC6zxP7SAAAi43zLEj4234.png "style=" float : none; "title=" screenshot from 2017-08-04 10-08-21.png "alt=" Wkiom1mfvc6zxp7saaai43zlej4234.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9D/C0/wKioL1mFVHrwjjgrAACcqiWDbGI640.png "title=" Screenshot from 2017-08-04 10-09-10.png "alt=" Wkiol1mfvhrwjjgraaccqiwdbgi640.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/C0/wKiom1mFVLyQepxKAACWOJN4-9k438.png "title=" Screenshot from 2017-08-04 10-10-59.png "alt=" Wkiom1mfvlyqepxkaacwojn4-9k438.png "/>
Local User Home Directory modification
Local_root=/directory
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9D/C0/wKiom1mFUvKwS_zdAAAfZmssXvo876.png "style=" float : none; "title=" screenshot from 2017-08-05 11-26-19.png "alt=" Wkiom1mfuvkws_zdaaafzmssxvo876.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/C0/wKioL1mFUvPza60HAACejbwQ_KU171.png "style=" float : none; "title=" screenshot from 2017-08-05 11-27-50.png "alt=" Wkiol1mfuvpza60haacejbwq_ku171.png "/>
Local User upload file permissions
Local_umask=xxx
Originally local_umask=022
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C0/wKiom1mFU0zQSe_9AACp1tSwoAU060.png "style=" float : none; "title=" screenshot from 2017-08-05 11-46-08.png "alt=" Wkiom1mfu0zqse_9aacp1tswoau060.png "/>
Change umask=002
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C0/wKioL1mFU0zy1LJCAAArSzVfixU423.png "style=" float : none; "title=" screenshot from 2017-08-05 11-46-55.png "alt=" Wkiol1mfu0zy1ljcaaarszvfixu423.png "/>
Permissions Change
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/C0/wKioL1mFU03zWMHwAADSGv3A_5Y744.png "style=" float : none; "title=" screenshot from 2017-08-05 11-48-08.png "alt=" Wkiol1mfu03zwmhwaadsgv3a_5y744.png "/>
Restrict local user Browse/directory
All users are locked into their home directory
Chroot_local_user=yes
chmod u-w/home/*
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/C0/wKiom1mFU9OQOYA4AAAMELNggAw723.png "style=" float : none; "title=" screenshot from 2017-08-05 12-37-05.png "alt=" Wkiom1mfu9oqoya4aaamelnggaw723.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/C0/wKioL1mFU9PgXEl2AACz0Mt1kro323.png "style=" float : none; "title=" screenshot from 2017-08-05 12-42-05.png "alt=" Wkiol1mfu9pgxel2aacz0mt1kro323.png "/>
User Whitelist Creation
Chroot_local_user=yes can browse/catalogue
Chroot_list_enable=yes Enable list
Chroot_list_file=/etc/vsftpd/chroot_list can browse/directory written in the list
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/C0/wKiom1mFU9Tg1XyUAAAMXSSrgo8442.png "style=" float : none; "title=" screenshot from 2017-08-05 12-43-22.png "alt=" Wkiom1mfu9tg1xyuaaamxssrgo8442.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/C0/wKioL1mFU9SzWKpRAAETJdTBlGY141.png "style=" float : none; "title=" screenshot from 2017-08-05 12-43-54.png "alt=" Wkiol1mfu9szwkpraaetjdtblgy141.png "/>
User blacklist establishment
Chroot_local_user=no cannot browse/directory
Chroot_list_enable=yes Enable list
Chroot_list_file=/etc/vsftpd/chroot_list cannot browse/directory in write list
Restrict Local User Login
Vim/etc/vsftpd/ftpusers User Permanent blacklist
Vim/etc/vsftpd/user_list User Temporary blacklist
Add Westos user to/etc/vsftpd/ftpusers
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/C1/wKiom1mFWzjh1OmiAAAcqwW7LeM280.png "style=" float : none; "title=" screenshot from 2017-08-04 13-48-18.png "alt=" Wkiom1mfwzjh1omiaaacqww7lem280.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C1/wKiom1mFWzfzbhKHAABtrk0LZMg466.png "style=" float : none; "title=" screenshot from 2017-08-04 13-41-28.png "alt=" Wkiom1mfwzfzbhkhaabtrk0lzmg466.png "/>
Westos user cannot log in
User White list settings
Userlist_deny=no added Userlist_deny=no in/etc/vdftp/vsftpd.conf config file
/etc/vsftpd/user_list enable the Userlist_deny=no parameter setting, this file becomes the user whitelist, only the user who appears in the list can log in FTP
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/C1/wKioL1mFWziAAERVAAAwR-Qu11c276.png "style=" float : none; "title=" screenshot from 2017-08-04 13-51-01.png "alt=" Wkiol1mfwziaaervaaawr-qu11c276.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C1/wKiom1mFWznyQwYPAAA-5w4ZO7E446.png "style=" float : none; "title=" screenshot from 2017-08-04 14-10-29.png "alt=" Wkiom1mfwznyqwypaaa-5w4zo7e446.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C1/wKioL1mFWzmAt-wpAABCtbEAgLU208.png "style=" float : none; "title=" screenshot from 2017-08-04 14-11-52.png "alt=" Wkiol1mfwzmat-wpaabctbeaglu208.png "/>
4.ftp Virtual user's settings
Create a virtual account identity
Vim/etc/vsftpd/loginusers Writing user password files (file name arbitrary)
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C1/wKioL1mFXtGSMVE2AAAm38SVhgw151.png "title=" Screenshot from 2017-08-04 14-32-14.png "alt=" Wkiol1mfxtgsmve2aaam38svhgw151.png "/>
Db_load-t-T hash-f/etc/vsftpd/loginusers loginusers.db encrypting files with hash algorithm
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/C2/wKiom1mFZAXSX1N4AABHExpyoDg072.png "title=" Screenshot from 2017-08-05 14-20-57.png "alt=" Wkiom1mfzaxsx1n4aabhexpyodg072.png "/>
VIM/ETC/PAM.D/CKVSFTPD encrypting files and configuration files with the PAM.D plugin
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/C1/wKiom1mFX1CjhozCAABIg6xSO54627.png "title=" Screenshot from 2017-08-04 15-04-22.png "alt=" Wkiom1mfx1cjhozcaabig6xso54627.png "/>
Vim/etc/vsftpd/vsftpd.conf
Pam_service_name=ckvsftpd
Guest_enable=yes
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/C2/wKiom1mFZ3GhEGv8AAA0Nx9TgtM147.png "title=" Screenshot from 2017-08-05 14-35-15.png "alt=" Wkiom1mfz3ghegv8aaa0nx9tgtm147.png "/>
Successful login with Ftpuser1 account
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/C1/wKioL1mFaE7RfFj2AACH4PmGGwk483.png "title=" Screenshot from 2017-08-05 14-38-55.png "alt=" Wkiol1mfae7rffj2aach4pmggwk483.png "/>
Add guest_username= user to config file, virtual account specify local identity login
Guest_username=ftpuser (local user)
chmod u-w/home/ftpuser
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/C1/wKioL1mFX8-xSg9gAABSDJC9Xrc033.png "title=" Screenshot from 2017-08-04 15-03-25.png "alt=" Wkiol1mfx8-xsg9gaabsdjc9xrc033.png "/>
Specify FTP User Login
Virtual Account Home directory independent settings
Create a separate user directory
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9D/C2/wKiom1mFaY-BljFiAADvHnM-Dcw087.png "style=" float : none; "title=" screenshot from 2017-08-04 16-43-43.png "alt=" Wkiom1mfay-bljfiaadvhnm-dcw087.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/C2/wKioL1mFaZChLf_CAAAmSUp7Ux4594.png "style=" float : none; "title=" screenshot from 2017-08-04 16-44-15.png "alt=" Wkiol1mfazchlf_caaamsup7ux4594.png "/>
Vim/etc/vsftpd/vsftpd.conf Open the VSTFPD configuration file and write the following two lines of configuration in the last face
local_root=/vuserdir/$USER different accounts into their own separate directories
user_sub_token= $USER declaring $user in a configuration file is a variable in the shell
Virtual Account configuration Independent permissions
vim/etc/vsftpd/vsftpd.conf Opening a configuration file
User_config_dir=/etc/vsftpd/userconf writes the standalone permission profile in the last line,userconf as a directory
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C2/wKiom1mFaZDw6UbdAABHmVZhs3Y048.png "style=" float : none; "title=" screenshot from 2017-08-04 16-45-31.png "alt=" Wkiom1mfazdw6ubdaabhmvzhs3y048.png "/>
Create a Directory
Mkdir-p/etc/vsftpd/userconf
Create a new configuration-independent profile in the creation directory, with the file name as a separate user name
Vim/etc/vsftpd/userconf/ftpuser1
Set all parameters in the configuration file in this file, high priority of this file, write Ftpuser1 can upload file configuration information
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C2/wKiom1mFaZHT_lw5AAAd9DuBSFQ716.png "style=" float : none; "title=" screenshot from 2017-08-04 16-48-40.png "alt=" Wkiom1mfazht_lw5aaad9dubsfq716.png "/>
Experimental results, Ftpuser1 can upload files, ftpuser2 cannot upload files
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/C2/wKioL1mFaZDiIxIVAAAt5Cikink445.png "style=" float : none; "title=" screenshot from 2017-08-04 16-47-23.png "alt=" Wkiol1mfazdiixivaaat5cikink445.png "/>
FTP Service for Linux