本文介紹如何經過Yum安裝Pure-ftpd,詳細操做步驟以下:數據庫
步驟一:配置yum源vim
備份(若有配置其餘epel源)session
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backuptcp
下載新repo 到/etc/yum.repos.d/ui
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repothis
yum makecache日誌
步驟二:yum安裝
yum install pure-ftpd -yip
步驟三:修改配置文件
vim /etc/pure-ftpd/pure-ftpd.confget
PureDB /etc/pure-ftpd/pureftpd.pdb
#去掉這行註釋,指定路徑,PureDB用戶數據庫文件
VerboseLog yes
#開啓日誌 /var/log/pureftpd.log
NoAnonymous yes
#拒絕匿名用戶登陸
PassivePortRange 48000 50000
#使用被動模式,限制端口。it
步驟四:建立帳戶,配置權限
groupadd ftpgroup
useradd -g ftpgroup -s /sbin/nologin -d /dev/null ftpuser
建立虛擬帳戶
pure-pw useradd test -d /data/ftp/ -u ftpuser -m
配置目錄權限
mkdir /data/ftp -p
chown ftpuser.ftpgroup /data/ftp/ -R
步驟五:配置防火牆策略
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 48000:50000 -j ACCEPT
步驟六:啓動pure-ftpd
chkconfig pure-ftpd --level 345 on
/etc/init.d/pure-ftpd start
pure-pw useradd <login> [-f <passwd file>] -u <uid> [-g <gid>]
-D/-d <home directory> [-c <gecos>]
[-t <download bandwidth>] [-T <upload bandwidth>]
[-n <max number of files>] [-N <max Mbytes>]
[-q <upload ratio>] [-Q <download ratio>]
[-r <allow client ip>/<mask>] [-R <deny client ip>/<mask>]
[-i <allow local ip>/<mask>] [-I <deny local ip>/<mask>]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw usermod <login> -f <passwd file> -u <uid> [-g <gid>]
-D/-d <home directory> -[c <gecos>]
[-t <download bandwidth>] [-T <upload bandwidth>]
[-n <max number of files>] [-N <max Mbytes>]
[-q <upload ratio>] [-Q <download ratio>]
[-r <allow client ip>/<mask>] [-R <deny client ip>/<mask>]
[-i <allow local ip>/<mask>] [-I <deny local ip>/<mask>]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw userdel <login> [-f <passwd file>] [-m]
pure-pw passwd <login> [-f <passwd file>] [-m]
pure-pw show <login> [-f <passwd file>]
pure-pw mkdb [<puredb database file> [-f <passwd file>]]
pure-pw list [-f <passwd file>]
-d <home directory> : chroot user (recommended) -D <home directory> : don't chroot user -<option> '' : set this option to unlimited -m : also update the /etc/pure-ftpd/pureftpd.pdb database For a 1:10 ratio, use -q 1 -Q 10 To allow access only between 9 am and 6 pm, use -z 0900-1800