1. 程式人生 > >pureftpd安裝使用文檔

pureftpd安裝使用文檔

pureftpd安裝使用文檔

1.環境

一鍵安裝包lnmp1.4.tar.gz中的pureftpd安裝腳本
安裝參考文檔:
http://blog.51cto.com/865516915/2064503
http://www.ttlsa.com/system/install-pureftpd/
http://www.zxdown.com/hanhua/1662.html
http://www.zxdown.com/hanhua/1662.html

2.配置和使用

cp /usr/local/pureftpd/etc/pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf.bak
egrep -v "^#|^$"  /usr/local/pureftpd/etc/pure-ftpd.conf.bak >/usr/local/pureftpd/etc/pure-ftpd.conf
[root@git-server pureftpd]# cd /usr/local/pureftpd/
[root@git-server pureftpd]# cd etc/
[root@git-server etc]# ls
pure-ftpd.conf   pure-ftpd.conf.bak  pureftpd.passwd  pureftpd.pdb

[root@git-server etc]# /etc/init.d/pureftpd restart
Restarting Pure-FTPd...
Stopping Pure-FTPd...   done
Starting Pure-FTPd...  done
[root@git-server etc]# netstat -lntup|grep pure-ftpd
tcp        0      0 0.0.0.0:21                0.0.0.0:*                   LISTEN      25749/pure-ftpd

Bind 0.0.0.0,1038

3.修改ftp的端口為1038

添加參數Bind 0.0.0.0,1038

[root@git-server etc]# cat pure-ftpd.conf
ChrootEveryone               yes
BrokenClientsCompatibility   no
MaxClientsNumber             50
Daemonize                    yes
MaxClientsPerIP              2
VerboseLog                   no
DisplayDotFiles              yes
AnonymousOnly                no
NoAnonymous                  yes
SyslogFacility               ftp
DontResolve                  yes
MaxIdleTime                  15
PureDB                       /usr/local/pureftpd/etc/pureftpd.pdb
LimitRecursion               10000 8
AnonymousCanCreateDirs       no
MaxLoad                      4
PassivePortRange             20000 30000
AntiWarez                    yes
Umask                        133:022
MinUID                       100
AllowUserFXP                 no
AllowAnonymousFXP            no
ProhibitDotFilesWrite        no
ProhibitDotFilesRead         no
AutoRename                   no
AnonymousCantUpload          yes
PIDFile                      /var/run/pure-ftpd.pid
MaxDiskUsage                   99
CustomerProof                yes
UserBandwidth                80
Bind                         0.0.0.0,1038

4.添加ftp虛擬用戶,前提是系統用戶www,必須是存在的

[root@git-server test03]# pure-pw useradd jiantest01 -u www -d /data/www/test01
Password: zykj@test01
Enter it again: zykj@test01
chown -R www.www /data/www/test01
[root@git-server test03]# pure-pw useradd jiantest02 -u www -d /data/www/test02
Password: zykj@test02
Enter it again: zykj@test02
chown -R www.www /data/www/test02
[root@git-server test03]# 
[root@git-server test03]# pure-pw useradd jiantest03 -u www -d /data/www/test03
Password: zykj@test03
Enter it again: zykj@test03
chown -R www.www /data/www/test03

註意:
新添加完用戶以及改完密碼,以及授權管理目錄時,必須修得要執行以下命令才可以生效
[root@git-server etc]# /usr/local/pureftpd/bin/pure-pw mkdb

查看用戶列表:

[root@git-server etc]#  /usr/local/pureftpd/bin/pure-pw list
jiantest01          /data/www/test01/./                                        
jiantest02          /data/www/test02/./                                        
jiantest03          /data/www/test03/./ 

查看密碼文件:

[root@git-server etc]# cat /usr/local/pureftpd/etc/pureftpd.passwd 
jiantest01:$6$5mDEpGv5S695qpk0$vVd9hoGBRTia3s3j1zughrG59Sq31k7c1lYdWaE27teqr6IT.ylZiHE61OeqB8R94yHPQDiYW8aKUCwB5NN1K0:501:501::/data/www/test01/./::::::::::::
jiantest02:$6$b2lVvgMFQI7Mps00$KQFYuoZKt3yR9zmDByR3vMN6G8A9Vac6ovdXr.ps903J/YfdAknaN1TfkqUmIfA6vuoOh4dICx/JfbvawOhgp1:501:501::/data/www/test02/./::::::::::::
jiantest03:$6$VbYXJjUEMGJMwcw0$Yn3HKwRtW6qAt4Saki/xFfiarC3kixYoFGZnTjXizNPOW59uscUergqf.u0Gvy0/jLcylZWAAwphrKj/FLgma0:501:501::/data/www/test03/./::::::::::::
[root@git-server etc]# 

如果添加完用戶以後想要刪除可以使用/usr/local/pureftpd/bin/pure-pw userdel jiantest01這條指令

[root@git-server etc]# /usr/local/pureftpd/bin/pure-pw userdel jiantest01
[root@git-server etc]# /usr/local/pureftpd/bin/pure-pw list
jiantest02          /data/www/test01/./                                        
jiantest03          /data/www/test03/./  

想要修改密碼可以使用/usr/local/pureftpd/bin/pure-pw passwd jiantest02這條指令

[root@git-server etc]# /usr/local/pureftpd/bin/pure-pw passwd jiantest02
Password: zykj123456
Enter it again: zykj123456

修改完密碼記得要執行以下命令才可以生效

[root@git-server etc]# /usr/local/pureftpd/bin/pure-pw mkdb

pureftpd安裝使用文檔