Small work for a period of time, found that although the online about this aspect has a lot of related tutorials, or is too simple, for small white students can not understand, or is very "high-end", the whole
For individuals, not commonly used or even a lifetime of things, so comprehensive online stickers and other resources, their own after trying to install debugging, finishing a tutorial below.
Since then, the small white classmate will no longer for Ubuntu under the VSFTPD install FTP server and worry! (PS: This is the simplest, best use of the tutorial; starting point: It's good to use)
This document is tested in Ubuntu Server 14.04 AMD64 System.
Install FTP
sudo apt-get install vsftpd
Configure vsftpd.conf
sudo nano/etc/vsftpd.conf
#禁止匿名访问anonymous_enable =no# Accept local user local_enable=yes# allow upload write_enable=yes# user can only access restricted directory chroot_local_user=yes# set fixed directory , added at the end. If you do not add this line, each user corresponding to their own directory, of course, this folder built Local_root=/home/ftp
Look at the online said add a line "pam_service_name=vsftpd", I think I this configuration file is already there, no matter.
Add FTP User
sudo useradd-d/home/ftp-m ftpusersudo passwd ftpuser
Adjust folder permissions
This is to avoid "OOPS:vsftpd:refusing to run with writable root inside Chroot ()"
sudo chmod a-w/home/ftpsudo mkdir/home/ftp/data
This will see the Data folder after login, although a little trouble, the reason is not table. It's hard to find information so bitter.
Change PAM.D/VSFTPD
This time directly with Useradd account login FTP will 530 login incorrect
sudo nano/etc/pam.d/vsftpd
Comment out
#auth Required Pam_shells.so
Restart VSFTPD
sudo service vsftpd restart
At this point you can use the Ftpuser just built this user login FTP, see is Local_root set/home/ftp, and limited in the directory.
can be accessed in the browser with FTP://XXX.XXX.XXX.XXX, also can use FTP software such as FLASHFXP, password is ftpuser password.
About User Access folder restrictions
By the Chroot_local_user, chroot_list_enable, chroot_list_file These three documents control, to transfer someone's passage:
First of all, chroot_list_enable good understanding, is: whether to enable Chroot_list_file configuration of the file, if yes indicates that the Chroot_list_file configuration of the file to take effect, otherwise does not take effect;
Second, Chroot_list_file is also simple, configure a file path, the default is/etc/vsftpd.chroot_list, the file will be filled with some account names. However, the meaning of these accounts is not fixed and is related to the configuration item Chroot_local_user. Described in the following article;
Third, Chroot_local_user for yes means that all users * cannot * switch to a directory other than the home directory, but! The user is listed in addition to the Chroot_list_file configuration file. Chroot_local_user for no means that all users can * switch to a directory other than the home directory, but! The user is listed in addition to the Chroot_list_file configuration file. It can also be understood that chroot_list_file lists the "exceptions" to the user.
"Failed to connect in PASV mode" prompt when client logs in
Edit/etc/vsftpd.conf
Last Added
Pasv_promiscuous=yes
Then restart the VSFTPD service.
sudo service vsftpd restart