Linux provides a lot of ftp Server, here I choose a secure, fast, simple vsftpd as an FTP server. This article was built under my own Ubuntu 10.10-32-bit system. The construction method is simple, according to this procedure, you can also fully build your own FTP server.
A brief description of VSFTPD
VSFTPD (Very Secure FTP Daemon, very secure FTP server). As the name implies, VSFTPD design is the starting point is security. At the same time, with the continuous upgrade of the version, VSFTPD has made great progress in performance and stability. In addition to excellent security and performance, there is also a good ease of use.
installation of two VSFTPD
Create a new folder under home ftpso that when you install vsftpd , the ftp will be automatically This user is added to the ftp user.
Before installing, make sure that the extranet is connected, because you need to download vsfstpd This package, about 119kB, for installation:
Command:sudo apt-get install vsftpd
default configuration for three VSFTPD
After the VSFTPD installation is complete, its default configuration is to disallow anonymous access and allow local users to log on. Its configuration file in the /etc/vsftpd.conf , with VI Open, you will find that many of them are commented out, only a few of the necessary options. Therefore, if you have special needs, you need to modify the configuration file yourself.
When the configuration is complete, perform a restart of ftp, command:sudo/etc/init.d/vsftpd restart
Is the default configuration file.
Iv.vsftpd -related configuration detailed
1. Anonymous user-related settings
Anonymous_enable=yes, change YES to No, disable anonymous user login
#non_mkdir_write_enable =yes, Remove the # comment and allow anonymous users to create a directory
#non_upload_enalbe =yes, remove # , allow anonymous users to upload
Anon_world_readable_only=yes, allow anonymous users to download, is forbidden by default, this can be added by itself.
Anon_other_write_enable=yes, set it to Yes , in addition to uploading and creating directories, you can also rename, delete files, default is NO
No_anon_password=no, set it to YES, anonymous users will not query the user password directly login.
FTP_USERNAME=FTP, anonymous user Login System account default is FTP, This item best not change, otherwise set
2.FTP Service Port designation
listen_port=8021, specifies that the command channel is 8021 and the default is
listen_data_port=8020, specifying a data channel of 8020, default
3. settings for upload mode
Pasv_enable=yes, it is allowed to use passive mode, by default.
pasv_min_port=10000, specifying the minimum value to open the port when using passive mode
pasv_max_port=10004, specifies the maximum number of ports to open when using passive mode.
4.VSFTP server Specifies IP address
listen_address=192.168.0.21, specifying FTP,IP address
Note: The specified IP is only allowed when the vsftp is running in standalone mode , if It is already established under the/ETC/XINETD.D directory VSFPD file, you must set the Disable in the file to Yes.
5. Lock users and prevent users from leaving the user home directory
Chroot_local_user=yes, set it to YES, locked in the user home directory, set to NO, can switch
To set the specified user to lock the user home directory :
#chroot_list_enable =yes
#chroot_list_file =/etc/vsftpd.chroot_list
Change it to read as follows :
Chroot_list_enable=no
Chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
Save the above and do the following:
#touch/etc/vsftpdvsftpd.chroot_list
#vi/etc/vsftpd/vsftpd.chroot_list, Add a user list to the file, such as:netseek_com
Traffic control for 6.VSFTPD servers
max_clients=100; the maximum number of connections allowed, defined as - , the default is 0 , the table has no restrictions
max_per_ip=5; each IP the number of connections allowed, 0 table has no restrictions and needs to be run in standalone mode before
anon_max_rate=50000; maximum bandwidth for anonymous users, in units of bps
local_max_rate=200000; Maximum system user Bandwidth
7.VSFTPD Custom Welcome Information
Directory Description Settings
#vi/etc/vsftpd.conf
#dirmessage_enable =yes, before the # removed.
Then we customize a . Message, write what you want to write, and then copy the file to the individual user's home directory , OK.
8.VSFTPD System Welcome Message Settings
Ftpd_banner=welcome to ftp.netseek.com, Yeah!!!
System Welcome message File Settings
Banner_file=/etc/vsftpd/welcome is similar to Ftpd_banner, except thatbanner_file Specifies the welcome file.
Five Practical tests
Testing on native and other machines ( including other systems ) can be accessed normally:
Native Access: Ftp://localhost
Access via Windows IE Browser:
ftp://172.18.125.113
Access through Windows Explorer:
Setting up an FTP server under Ubuntu