Construction of FTP service under <linux >

Source: Internet
Author: User

The FTP package that is installed by default is available for download by anonymous users.
Anonymous can be uploaded later:
# Getsebool-a | grep FTP
Chcon-t public_content_rw_t Pub
chmod 775 Pub

Anonymous users can create directories:

You cannot see the uploaded file in the created directory. Add the following

You cannot delete a directory file that you created: add the following

When SELinux is turned on, the default local user is not allowed to log on to FTP.
[Email protected] pub]# lftp Lee
LFTP [email protected]:~> ls
Ls:login failed:500 oops:cannot Change Directory:redhat
# setsebool-p Ftp_home_dir on

Default Local User login FTP is switchable to/
How to make local not be able to switch to/
#chroot_list_enable =yes
# (default Follows)
#chroot_list_file =/etc/vsftpd/chroot_list
can be locally switched to/
#chroot_list_ Enable=yes
# (default follows)
#chroot_list_file =/etc/vsftpd/chroot_list
The user in the Chroot_list file can switch to/, The reverse is that the profile is not written by the user is not everything to the/
# (default follows)
Chroot_ List_file=/etc/vsftpd/chroot_list
# touch/etc/vsftpd/chroot_list
All users can switch to/, the contents of the configuration file can not be switched to/, if the file is empty, It's all going to be all right, except for anonymous users.
# (default follows)
Chroot_list_ File=/etc/vsftpd/chroot_list
All will not be changed to/
# (default Follows)

2 blacklist contains a single user, Ftpusers priority is greater than user_list
Ftpusers user_list//These 2 documents will be changed to take effect
All users are not allowed to log on to FTP when the whitelist is empty. It also turns the temporary blacklist into a whitelist.

The establishment of FTP virtual user;
Vim Users
# yum Install Db4-utils.x86_64-y
# db_load-t-T hash-f users users.db

Vim Ftpusers
Auth Required Db=/etc/vsftpd/users
Account Required Db=/etc/vsftpd/users

# vim/etc/vsftpd/vsftpd.conf//directory with virtual user login is the test directory.
Guest_username=test//Use as Local user
Client testing, we will find the home directory that is logged in to test

Add a home directory to a virtual user
[Email protected] vsftpd]# tree virtual/
virtual///Change the directory and create 2 more User1 User2

/etc/vsftpd/virtual//Modify directory permissions for User1 User2
# chcon-t public_content_rw_t
[email protected] virtual]# LL
Total 8
Drwxr-xr-x. 2 test test 4096 June 01:27 user1
Drwxr-xr-x. 2 test test 4096 June 01:11 User2
Add a home directory for the virtual FTP user, the configuration file to write to the following content
user_sub_token= $USER

Add a configuration file for a virtual user
mkdir dir
Vim user1//user1 for User1 user's FTP configuration file
Non_upload_enable=no//user1 User is forbidden to upload, by default it can be uploaded

Related Article

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: 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.