Ubuntu under the recognition of the most easy to use FTP software is vsftpd, since the title is said to be "simple", then must be the most popular. Here's the chase.
Target Requirements: build an FTP that allows anonymous/local login, and support the upload/download/modify function, while the FTP port can be determined autonomously, and the root directory of the FTP can be determined autonomously.
PS: In the deployment process encountered any problems can first look at the bottom of this article the note section, perhaps you are experiencing the problem is I have encountered and resolved the ^. ^
Step One: Install VSFTPD
sudo apt-get update # Updates source
sudo apt-get install vsftpd # installation (VSFTPD starts immediately after installation, via Ps-ef | grep VSFTPD See the vsftpd already started)
Here is a sudo apt-get purge vsftpd used to completely unload the vsftpd so that you can clean it up when you accidentally change the mess
Step Two: Prepare the FTP root directory
Mkdir-p/xx/xx/foldername # Create a folder, such as Mkdir-p/home/milk/ftprootfolder
chmod 755/xx/xx/foldername # To change the folder usage permissions for the FTP root directory to 755, this step is critical,
# because VSFTPD does not allow root permissions to be fully open for security reasons, 777 causes no display
Mkdir-p/xx/xx/foldername/games
chmod 777/xx/xx/foldername/games # Create a folder with permissions of 777 under the FTP root folder, and upload and download (games) here
Step Three: Open firewall port
UFW control all the internal and external data interaction, must cross the firewall, the following two ways and choose a
(1) sudo ufw Disable # recommended the use of the neural bar, the firewall was wasted, straightforward
(2) sudo ufw allow 20 and sudo UFW enable 21 # allows FTP two classic ports to pass
Step four: Write the vsftpd configuration file vsftpd.conf
PS:VSFTPD has a lot of configuration options, and below are just a few of the required options to meet the basic requirements above, and interested or other special needs to see the reference list at the bottom of this article
Configuration file in/etc/vsftpd.conf recommended before the change, the original configuration file only give some common options, the rest of the other options need to find and add, the following is to meet the above requirements of the necessary options, there are a few options are not in the original configuration file, pay attention to check
Listen=yes # turn on Independent listening mode
#listen_ipv6 =yes # This option can not and listen at the same time for YES, because there is no need to comment out, the specific function please Google, a lot of places are talked about
Anonymous_enable=yes #允许匿名访问
Local_enable=yes #允许本地访问
Write_enable=yes #允许本地访问者有写权限
local_umask=000 #本地访问者权限掩码最小化 (equivalent to no permission restrictions, but not equal to direct open access)
anon_umask=000 #匿名用户权限掩码最小化
Anon_upload_enable=yes #匿名用户拥有上传权限
Anon_mkdir_write_enable=yes # Anonymous user has Create folder permissions
Anon_other_write_enable=yes # Anonymous users have other write permissions, such as deleting
Anon_world_readable_only=yes # Anonymous users have full View permissions
Dirmessage_enable=yes # Dynamic Directory information
Connect_from_port_20=yes # Ensure that the FTP data interface is port 20 (remember to let UFW allow port access)
Ftpd_banner=welcome to blah FTP service. # Welcome slogan, recommended for polite use
Anon_root=/xx/xx/foldername # Set the FTP root of anonymous users (the so-called root directory is the first to see the directory.) )
Local_root=/xx/xx/foldername # Set the FTP root directory for local users (the default directory looks like ... Please google separately)
# listen_port=4783 # Set Listening port (default is Port 21)
# listen_address=127.0.0.1 #设置本地监听IP, not many network cards generally do not need
Step five: Turn on/Restart the VSFTPD service to make the configuration file effective
sudo service vsftpd start # must use sudo to turn on VSFTPD services (just open FTP)
sudo service vsftpd Restart # Restart VSFTPD services, quite with first close and then open
sudo service vsftpd stop #关闭vsftpd服务 (FTP also to work)
PS: Available through netstat | Grep:21 to see if the specified FTP port is open by Ps-ef | grep vsftpd to see if the service process started
Step Six: Share your small action movies with chick friends via vsftpd
Note:
1. Why does the error say what is not ... binding ipv4/ipv6 socket ... Failed to bind IPv6 and listen_ipv6=yes about, as for IPv4, it does not seem to affect the use of
2. Run sudo service vsftped stop results burst Stop:not instance: In fact your vsftpd has closed, with Ps-ef | grep vsftpd Look
3. Sudo vsftpd can also start the VSFTPD service
4. How can I not upload or create more can't delete? Please carefully check the permissions of the FTP folder, give a nerve bar of the suggestion: FTP root permissions 755, the rest of the 777, and don't forget to check the configuration file on the permissions of the visitor is set correct, ah ah ah, there is UFW firewall also see
Reference:
1. VSFTPD configuration options Daquan: Http://blog.sina.com.cn/s/blog_590262b40101flrp.html and Http://os.51cto.com/art/200901/106622.htm
2. About viewing processes and networks: http://forum.ubuntu.org.cn/viewtopic.php?t=463243
3. About setting up a local Access user account: http://www.while0.com/36.html
4. About FTP root file permission settings: http://m.blog.csdn.net/blog/li_yaya/7747052
5. Advanced Application Detail configuration: http://blog.chinaunix.net/uid-526789-id-3773984.html
Easy FTP Server Setup under Ubuntu 14.10 [VSFTPD]