Ubuntu comes with FTP server vsftpd tips

  
                  To achieve Apache multi-user virtual host settings, then these users will generally choose to use ftp upload to manage their web content, which requires us to open FTP services for him.
Ubuntu comes with an FTP server that is vsftpd.
1. Installing vsftpd
Ubuntu installation software is not a difficult thing, enter:
sudo apt-get install vsftpd
If there is no source You may be prompted to use the CD, put it in and press Enter.
I use the source of CN99, the speed is 300K per second, fast enough.
After installation, an ftp directory will be created under /home/. At this time you can try to access the ftp://IP address. You should be able to see a blank ftp space.
Anonymous users can download under the default settings, but can't write or upload
2, set vsftpd.conf file
Now we have to make anonymous users inaccessible, and we have to enter the user password on Linux. Access content in their own directory.
First find the file to set vsftpd, the location is best to back up this file before the /etc/vsftpd.conf
modification:
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.old
You can change it now:
#Do not allow anonymous users to use
#anonymous_enable=YES
#Local users available
local_enable=YES
#Available write operations
write_enable=YES
#Do not need to display file information in a certain directory
#dirmessage_enable=YES
#Add a banner hint
ftpd_banner=Hello~~
#Maximum host user of FTP server
max_clients=100< Br>New question
1. The location displayed after entering the username and password is in the user's root directory, and our WEB content is in the public_html directory
2, the user can jump to any other directory
To solve these problems we have to set vsftpd.conf
#start chroot list (Change root)
chroot_list_enable=YES
#Specify the list location (I use the default address)
chroot_list_file =/etc/vsftpd.chroot_list
Next we have to write in vsftpd.chroot_list which users we want to limit, not let him "Drift"...
There is now user linyupark, so as long as sudo nano, it will be written inside.
This way we have solved the second problem, the logged in user can only be active in its user folder. Next, we have to be a bit more sloppy, so that he can only live in public_html

still find vsftpd.conf
# This is not the default setting, add
user_config_dir=/Etc /yourself define a folder address for individual users
according to their own address, create a corresponding folder, and then create the same file with the user name, nano:
# local user Root address, assuming the user is linyupark
local_root=/home/linyupark/public_html

Reboot the server.
Copyright © Windows knowledge All Rights Reserved