Original: Ubuntu Configure FTP server with VSFTPD
The article on the Internet is very difficult to understand AH. Just want to be simple and rough, ready to use on the line Ah, complex later study not ... Toss for a long time, actually get out can use not so little content ...
this text in Ubuntu Server 14.04 AMD64 system test.
Made By:csgrandeur
Install FTP
sudo 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 ftpusersudopasswd ftpuser
Adjust folder permissions
"OOPS:vsftpd:refusing to run with writable root inside Chroot ()"
sudo chmod a-w /home/ftp sudo mkdir /home/ftp /data
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 Chroot_local_user,chroot_list_enable,Chroot_list_file These three files control, to turn someone's passage:
First, chroot_list_enable good understanding is: whether to enable Chroot_list _file the configured file, if yes indicates that the Chroot_list_file configuration file is in effect, otherwise it will not take effect;
Second, Chroot_list_file is also simple, configure a file path, 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.
third, Chroot_local_ User Yes indicates 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.
If the client is logged in with the prompt "PASV mode connection Failed"
edit/etc/vsftpd.conf
Last Added
Pasv_promiscuous=yes
Then restart the VSFTPD service.
Ubuntu Configuring an FTP server with VSFTPD