pureftpd installation configuration

1 pureftpd installation configuration, download pureftpd
#cd /usr/local/src/tarbag

#wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.22.tar.gz
2, extract pureftpd
#tar –xzvf pure-ftpd-1.0.22.tar.gz –C ../software/
3, compile and install pureftpd #cd pureftpd-1.0.22 # .configure \ -prefix = / usr / local / pureftpd \ // pureftpd installation directory -with-everything \ // install almost all the functions, including altlog, cookies, throttling, ratios, ftpwho, upload script, virtual users (puredb), quotas, virtual hosts, directory aliases, external authentication, Bonjour, privilege separation. --with-cookie \ // When the user logs in to display the specified banner --with-diraliases \ // support directory aliases, on behalf of the cd command shortcuts --with-extauth \ // compiler module supports Extended Validation, large most users do not use this option --with-ftpwho \ // support pure-ftpwho order to enable this feature requires more extra memory --with-language = english \ // modify the server language, English is the default, if you want to make changes, please translate 'src / messages_en.h' file --with-ldap \ // LADP directory support, you need to install openldap --with-minimal \ // FTP minimal installation, the most basic functions --with-mysql \ // MySQL support, if MySQL is installed on a custom directory, you need to use the command -with-mysql = / usr / local / mysq such --with-nonroot \ // does not require root user can start the service if appear configure : error: liblber is needed for LDAP support, need to install openldap-devel appear if configure: error: Your MySQL client libraries aren '
#cd /usr/local/src/software/pure-ftpd-1.0.22 //切换到源码目录

#cd configura-files //切换到这个目录

#chmod 755 pure-config-pl //让用户有完全权限(因为默认没有执行权限)

#cp pure-config-pl /usr/local/pureftpd/bin //把执行文件复制到bin目录下

#mkdir /usr/local/pureftpd/etc //新建FTP的配置文件夹目录

#cp pure-ftpd.conf /usr/loca.l/pureftpd/etc //复制ftp配置文件到etc中

#cd .. //切换到/pure-ftpd-1.0.22目录中

#cp pureftpd-ldap.conf /usr/local/pureftpd/etc //相关配置文件复制到etc中

#cp pureftpd-mysql.conf /usr/local/pureftpd/etc //相关配置文件复制到etc中

#cp pureftpd-pgsql.conf /usr/local/pureftpd/etc //相关配置文件复制到etc中

5、pure-ftpd.conf配置

ChrootEveryone yes //锁定所有用户到家目录中

# TrustedGID 100 //信任组ID100,可以不锁定

MaxClientsNumber 50 //最大的客户端数量

MaxClientsPerIP 8 //同一个IP允许8个链接

DisplayDotFiles no //不显示隐藏文件

AnonymousOnly no //只允许匿名用户

NoAnonymous yes//不允许匿名用户

DontResolve yes //禁止反向解析

MaxIdleTime 10 //最大空闲10分钟

# LDAPConfigFile /etc/pureftpd-ldap.conf //LDAP配置文件目录

# MySQLConfigFile /etc/pureftpd-mysql.conf//MySQL配置文件目录

# PGSQLConfigFile /etc/pureftpd-pgsql.conf //PGSQL配置文件目录

PureDB /usr/local/pureftpd/etc/pureftpd.pdb //虚拟用户数据库

# UnixAuthentication yes //主机认证

LimitRecursion 2000 8 //别表最大显示2000个文件,最深8个目录

AnonymousCanCreateDirs no //是否允许匿名用户创建目录

#MaxLoad 4 //最多可下载的数量

# PassivePortRange 30000 50000 //主动连接的端口范围

ForcePassiveIP 192.168.0.1 //这个地址总是直到匿名目录

# AnonymousRatio 1 10 //匿名用户上传下载速度比率

# UserRatio 1 10 //用户上传下载速度比率

# Bind 127.0.0.1,21 //绑定IP和端口

# AnonymousBandwidth 8 //匿名用户带宽8KB

# UserBandwidth 8 //用户带宽8KB

Umask 133:022 //文件和目录的umask

MinUID 1000 //用户ID至少要大于1000才能登陆

AllowUserFXP no //是否允许用户使用FXP协议登陆

AllowAnonymousFXP no //是否允许匿名用户使用FXP协议

ProhibitDotFilesWrite no //是否允许写入点文件

ProhibitDotFilesRead no //是否允许读取点文件

AnonymousCantUpload yes //不允许匿名用户上传

#NoChmod yes //不允许用户改变权限

#KeepAllFiles yes //允许用户断点续传

#Quota 1000:10//磁盘配额

#MaxDiskUsage 99 //磁盘的最大利用率

#NoRename yes //不允许自动重命名

IPV4Only yes //只允许使用IPV4协议
6, New Virtual User Note: You need to create a combined user (part of the operating system) before the New Virtual User.
#groupadd –g 1000 ftpgroup //新建一个指定组ID为1000的系统组

#useradd –g 1000 –u 1000 –d /dev/null –s /sbin/nologin ftpuser //新建用户ID1000加入ftpgroup中

#cd /usr/local/pureftpd/bin //切换到bin目录中

#./pure-pw useradd puser –u ftpuser –d /www/ftptest –m

//pure-pw useradd 虚拟用户名 –u 寄生到系统用户名 –d FTP目录 –m(把用户密码加入PDB数据库中,不需要重启FTP)

#cd /www //切换到WWW中

#chown –R ftpuser:ftpgroup ftptest //把FTP目录的所属用户和组改为虚拟用户所依托的系统用户和组
7 to start the test
#/usr/local/pureftpd/bin/pure-config-pl /usr/local/pureftpd/etc/pure-ftpd.conf

Running: /usr/local/pureftpd/sbin/pure-ftpd -A -c50 -B -C8 -E -fftp -H -I10 
-lpuredb:/usr/local/pureftpd/etc/pureftpd.pdb -L2000:8 -s -U133:022 -u1000 -i -Z-4
NOTE: If you start running successfully explained. Next ftP test connection 8, pureftpd allow only single ip login
#cd /usr/local/pureftpd/sbin

#./pure-pw usermod puser –r 218.66.36.119 –m

(备注:-R 只允许的IP地址,其他任何IP地址都会拒绝掉)

#./pure-pw usermod pure –r “”

(-r 加上””会把之前允许的都清空掉,这样以来所有的IP都可以访问ftp)
  9, see the list of users
# ./pure-pw list
10, see the detailed user settings
#./pure-pw show puser
(If pureftpd 530 Sorry appear, but I can not trust you an error message, and then configure the steps and configuration files are correct, try again at the server, observe this problem can be resolved) 11: since the start of the next rhel pureftpd achieve
# cd /usr/local/src/software/pure-ftpd-1.0.22/contrib/

# ls

Makefile Makefile.in pure-vpopauth.pl suse.init

Makefile.am pure-stat.pl redhat.init xml_python_processors.txt

# cp redhat.init /etc/init.d/pureftpd

# chmod 755 /etc/init.d/pureftpd

# chkconfig --add pureftpd

# chkconfig pureftpd on

# service pureftpd restart

Stopping pure-config.pl:

Starting pure-config.pl: Running: /usr/local/pureftpd/sbin/pure-ftpd --daemonize

-A -c50 -B -C10 -E -fftp -H -I10 -lpuredb:/usr/local/pureftpd/etc/pureftpd.pdb

-s -U133:022 -u1000 -R -4
If an error occurs, check the startup script /etc/init.d/pureftpd defined path is correct.

Reproduced in: https: //my.oschina.net/766/blog/211126

Guess you like

Origin blog.csdn.net/weixin_34100227/article/details/91493159