one, the installation command
Yum-y Install VSFTPD
Ii. Creating an FTP user on Linux
# useradd-s/SBIN/NOLOGIN-G ftp-d/Your directory-m username
# passwd Users
-s/sbin/nologin Disable user SSH login
To which group-G is added
-G can be added to multiple groups with comma-separated names
-D Specify user directory
Third, lock the root directory
1, modify the vsftpd.conf
Anonymous_enable=no
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd/chroot_list
Userlist_enable=no
2. Create the/etc/vsftpd/chroot_list file and add the user name to the file (one user name per line).
3. In the/etc/vsftpd/user_list file, add the user name to the file, one line at a time.
4, such as your directory is/data, you need to change/data users and user groups, such as your user name is Ftpadmin
Chown-r Ftpadmin:ftp/data
5. Restart the FTP service
Service VSFTPD Restart
Iii. explanation in the configuration file
1, anonymous_enable=yes open Anonymous user login
2, local_enable=yes open Local User Login
3, Write_enable=yes open Write permission to upload
4, local_umask=022 set upload file for user=rwx, group=, other=
This way, after the user uploads the file, it cannot be deleted or modified. Because the user belongs to group groups.
The workaround is to set the local_umask=002.
Final file permission is 777-Folder mask-local_umask mask
5, Anon_upload_enable=yes open Anonymous user upload permission
Unified Anonymous upload properties of uploaded files by users
6, Chown_uploads=yes
Chown_username=ftp
Set chroot configuration to prohibit specific users from accessing the previous level of directory
7, Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd/chroot_list
Userlist_enable=yes This option if yes, users in the/etc/vsftpd/user_list will be prevented from accessing FTP. If no, only users inside the User_list can access the FTP
Linux Build FTP