First, install the PUREFTPD
[Email protected] ~]# cd/usr/local/src/[[email protected] src]# wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.32.tar.bz2[Email protected] src]# tar jxf pure-ftpd-1.0. +. Tar.bz2[[email protected] src]# CD Pure-ftpd-1.0. +[email protected] pure-ftpd-1.0. +]# ./Configure--prefix=/usr/local/pureftpd--without-inetd--with-Altlog--with-Puredb--with-throttling--with-peruserlimits--with-TLS
[email protected] ~]# Yum install-y vsftpd db4-~]# useradd virftp-s/sbin/nologin // set up virtual account related Linked system Account [[email protected] ~]# vim/etc/vsftpd/// join, this text line is account, double action password test1 123456 test2 /etc/vsftpd/~]# db_load-t-t hash-f/etc/vsftpd/vsftpd_login/ Etc/vsftpd/vsftpd_login.db // generate the corresponding library file
[email protected] pure-ftpd-1.0. +]# make [[email protected] pure-ftpd-1.0. +]# make Install[[email protected] pure-ftpd-1.0. +]# CD configuration-File[[email protected] Pure-ftpd-1.0. +]# mkdir-p/usr/local/pureftpd/etc/[[email protected] configuration-file]# CP pure-ftpd.conf/usr/local/pureftpd/etc/pure-Ftpd.conf[[email protected] configuration-file]# CP pure-config.pl/usr/local/pureftpd/sbin/pure-Config.pl[[email protected] configuration-file]# chmod755/usr/local/pureftpd/sbin/pure-Config.pl[[email protected] configuration-file]# vim/usr/local/pureftpd/etc/pure-ftpd.conf//Copychrooteveryone yesbrokenclientscompatibility Nomaxclientsnumber -daemonize Yesmaxclientsperip8verboselog nodisplaydotfiles yesanonymousonly nonoanonymous Nosyslogfacility ftpdontresolve Yesmaxidletime thePuredb/usr/local/pureftpd/etc/pureftpd.pdblimitrecursion3136 8anonymouscancreatedirs nomaxload4Antiwarez Yesumask133:022Minuid -ALLOWUSERFXP NOALLOWANONYMOUSFXP noprohibitdotfileswrite noprohibitdotfilesread Noautorename noanonymouscantupload Nopidfile/usr/local/pureftpd/var/run/pure-Ftpd.pidmaxdiskusage AboutCustomerproof Yes//Start pureftpd[Email protected] ~]#/usr/local/pureftpd/sbin/pure-config.pl/usr/local/pureftpd/etc/pure-ftpd.conf//starts successfully and displays a long line of information beginning with running//Create an account[Email protected] ~]# mkdir/data/www/[[Email protected]~]# useradd www[[email protected]~]# Chown-r www:www/data/www/[[Email protected]~]#/USR/LOCAL/PUREFTPD/BIN/PURE-PW useradd ftp_user1-uwww-d/data/www/Password:enter it again:[[email protected]~]#/usr/local/pureftpd/bin/pure-PW MKDB//add an account again[Email protected] ~]#/USR/LOCAL/PUREFTPD/BIN/PURE-PW useradd ftp_user2-uwww-d/tmp//List the current account[Email protected] ~]#/usr/local/pureftpd/bin/pure-PW List//Delete Account[Email protected] ~]#/USR/LOCAL/PUREFTPD/BIN/PURE-PW Userdel ftp_user2
Second, test pureftpd
//testing requires tools[email protected] ~]# Yum Install-y lftp//Test[Email protected] ~]# touch/data/www/123. Txt[[email protected]~]# lftp [email protected]127.0.0.1Password: lftp [email protected]127.0.0.1:~>LSDRWXR-xr-x2 514Www4096June A One: -. DRWXR-xr-x2 514Www4096June A One: - ..-rw-r--r--1 514Www0June A One: - 123. txt//after logging in, use the LS command to list what files are in the current directory.
==================== I'm a split line. ================
First, VSFTPD
[email protected] ~]# Yum install-y vsftpd db4-Utils[[email protected]~]# useradd-s/sbin/nologin virftp//establish the System account associated with the virtual account[Email protected] ~]# Vim/etc/vsftpd/vsftp_login//Create a virtual account-related file//Join/*This file line is user name, double behavior password*/test1123456Test2abcdef[[email protected]~]# chmod -/etc/vsftpd/Vsftpd_login[[email protected]~]# db_load-t-T hash-f/etc/vsftpd/vsftpd_login/etc/vsftpd/vsftpd_login.db//generate the corresponding library file[Email protected] ~]# mkdir/etc/vsftpd/vsftpd_user_conf//Create virtual account related directories and configuration files[Email protected] ~]# Vim/etc/vsftpd/vsftpd_user_conf/test1//Create a test1 corresponding configuration file//Joinlocal_root=/home/virftp/test1anonymous_enable=nowrite_enable=Yeslocal_umask=022anon_upload_enable=noanon_mkdir_write_enable=Noidle_session_timeout= -Data_connection_timeout= -max_clients=Tenmax_per_ip=5local_max_rate=50000[[Email protected]~]# mkdir-p/home/virftp/test1//ftp folder for user name Test1[Email protected] ~]# chown-r virftp:virftp/home/Virftp[[email protected]~]# vim/etc/pam.d/vsftpd//add two lines at the beginning/*if the Linux system is 64-bit, change to/lib64/security/pam_userdb.so*/Auth Sufficient/lib/security/pam_userdb.so db=/etc/vsftpd/Vsftpd_loginaccount Sufficient/lib/security/pam_userdb.so db=/etc/vsftpd/Vsftpd_login[[email protected]~]# vim/etc/vsftpd/vsftpd.conf//Modify as required... anonymous_enable=yes Change to Anonymous_enable=no#anon_upload_enable=yes Change to Anon_upload_enable=no#anon_mkdir_write_enable=yes Change to Anon_mkdir_write_enable=No#chroot_local_user=YES to remove comments ... #文件最尾部加入guest_enable=Yesguest_username=Virftpvirtual_use_local_privs=Yesuser_config_dir=/etc/vsftpd/Vsftpd_user_conf[[email protected]~]#/etc/init.d/vsftpd Start
Second, test vsftpd
[email protected] ~]# Yum Install-y lftp [[email protected]~]# cat/etc/vsftpd/Vsftpd_logintest1123456Test2abcdef[[email protected]~]# lftp [email protected]127.0.0.1Password: lftp [email protected]127.0.0.1:~>lslftp [email protected]127.0.0.1:~>Quit[[email protected]~]# cd/home/virftp/Test1[[email protected]~]# Touch2. Txt[[email protected]~]# mkdir123[[Email protected]~]# lftp [email protected]127.0.0.1Password: lftp [email protected]127.0.0.1:~>LSDRWXR-xr-x2 0 0 4096Apr - -: the 123-rw-r--r--1 0 0 0Apr - -: the 2. txt
Configuration VSFTPD encountered an error:
lftp [email protected]127.0. 0.1:~> ls up to: anon_upload_enable -- because your yes/no boolean value (bool value ) is followed by a space, that is: anon_upload_enable=NO space to view /etc/vsftpd/vsftpd.conf and/etc/vsftpd/vsftpd_user_conf/test1 in anon_upload_enable= noafter space The correct format should be: anon_world_readable_only=No (no spaces)!!!!!! Note that the space behind the no, you want to use the backspace bar to delete it.
Ftp--vsftp\pureftpd