Linux Build FTP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.