# Create a virtual user password certified database file Db_load-t-T Hash-f/etc/vsftpd/vuser/etc/vsftpd/vuser.db # Direct Edit Authentication file Vi/etc/pam.d/vsftpd # Empty the contents or comment out (front plus #), add the following two lines Auth Required pam_userdb.so Db=/etc/vsftpd/vuser Account Required Pam_userdb.so Db=/etc/vsftpd/vuser # Edit the vsftp configuration file Vi/etc/vsftpd/vsftpd.conf ################################# Local_enable=yes Write_enable=yes local_umask=022 Anon_upload_enable=no Anon_mkdir_write_enable=no Dirmessage_enable=yes Xferlog_enable=yes Connect_from_port_20=yes Chown_uploads=no Xferlog_file=/var/log/vsftpd.log Xferlog_std_format=yes Async_abor_enable=yes Ascii_upload_enable=yes Ascii_download_enable=yes Ftpd_banner=welcome to Elain FTP service. Chroot_list_enable=yes Chroot_list_file=/etc/vsftpd/chroot_list Chroot_local_user=no Listen=yes Pam_service_name=vsftpd Userlist_enable=yes Tcp_wrappers=yes Guest_enable=yes Guest_username=vuser User_config_dir=/etc/vsftpd/vuser_config Reverse_lookup_enable=no ############################## # Create configuration files for each virtual user Vi/etc/vsftpd/vuser_config/ftp1 # Add the following content ############################ Local_root=/www/htdocs/ftp1 Write_enable=yes Anon_world_readable_only=no Anon_upload_enable=yes Anon_mkdir_write_enable=yes Anon_other_write_enable=yes ############################ www.111cn.net # The same way to build FTP2, if users have more words, write/etc/vsftpd/vuser to generate password-authenticated database files Mkdir-p/www/htdocs/ftp{1,2} echo "FTP1 is OK" >/www/htdocs/ftp1/ftp1.txt echo "FTP2 is OK" >/www/htdocs/ftp2/ftp2.txt Chown-r VUSER/WWW/HTDOCS/FTP1 Chown-r VUSER/WWW/HTDOCS/FTP2 # Start VSFTP Server /ETC/INIT.D/VSFTPD restart # Verify Login |