编译安装ProFTPd
分类:技术相关日期:2010-07-25作者:邋遢猪仔
下载,编译,安装
#下载proftpd源文件,目前最新版本是1.3.3
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3.tar.gz
#解压源文件
tar -zxvf proftpd-1.3.3.tar.gz
#进入源文件目录
cd proftpd-1.3.3/
#设置编译选项
./configure –with-modules=mod_quotatab:mod_quotatab_file:mod_unique_id –prefix=
#编译
make
#安装
make install
ProFTPd的一些工具设置
#复制ftpasswd和ftpquota到/usr/local/sbin目录
cp -p contrib/ftpasswd contrib/ftpquota /usr/local/sbin/
#对ftpasswd和ftpquota添加可执行权限
chmod +x /usr/local/sbin/ftpasswd /usr/local/sbin/ftpquota
#安装proftpd为服务,并设置为自动启动
cp -p contrib/dist/rpm/proftpd.init.d /etc/init.d/proftpd
chmod +x /etc/init.d/proftpd
chkconfig –level 2345 proftpd on
用户文件,日志目录
touch /etc/proftpd.passwd
mkdir /var/log/proftpd/
chown ftp.ftp /var/log/proftpd/
/etc/proftpd.conf 配置文件示例
ServerName "ProFTPD"
ServerType standalone
DefaultServer on
Port 21
PassivePorts 35000 35999
UseIPv6 on
Umask 022
User nobody
Group nobody
UseReverseDNS off
IdentLookups off
TimesGMT off
TimeoutLogin 120
TimeoutIdle 600
TimeoutNoTransfer 900
TimeoutStalled 3600
TransferLog /var/log/proftpd/xferlog.legacy
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"
LogFormat write "%h %l %u %t \"%r\" %s %b"
MaxInstances 30
AuthUserFile /etc/proftpd.passwd
QuotaEngine on
QuotaShowQuotas off
QuotaDisplayUnits Mb
QuotaLimitTable file:/etc/proftpd.quota
DeferWelcome on
ServerIdent off
MaxConnectionRate 4
MaxClients 30
MaxClientsPerHost 5
MaxClientsPerUser 10
RequireValidShell no
DefaultRoot ~
AllowStoreRestart on
AllowRetrieveRestart on
ListOptions -a
DisplayLogin /etc/proftpd.welcome
DisplayChdir /etc/proftpd.readme
AllowOverwrite yes
ScoreboardFile /var/run/proftpd.pid
ExtendedLog /var/log/proftpd/access.log WRITE,READ write
ExtendedLog /var/log/proftpd/auth.log AUTH auth
<Anonymous /home/ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 10
MaxClientsPerHost 1
DisplayLogin /etc/proftpd.welcome.anonymous
DisplayChdir /etc/proftpd.readme.anonymous
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
上面的Anonymous是匿名帐户的设置,可去除。
工具ftpasswd示列
#添加用户newphp,系统UID是501,GID是501,授权访问/home/newphp目录,–gecos后面可以跟这个帐号的说明,也可以不要。
ftpasswd –passwd –file=/etc/proftpd.passwd –name=newphp –uid=501 –gid=501 –gecos=newphp –home=/home/newphp –shell=/sbin/nologin
#删除用户newphp,系统UID是501,GID是501,授权访问/home/newphp目录,–gecos后面可以跟这个帐号的说明,也可以不要。
ftpasswd –passwd –file=/etc/proftpd.passwd –name=tiankun –uid=501 –gid=501 –gecos=newphp –home=/home/newphp –shell=/sbin/nologin –delete-user
#修改tiankun的密码,执行以后输入两次密码
ftpasswd –passwd –change-password –file=/etc/proftpd.passwd –name=tiankun
#修改newphp帐号的密码,newpasswd是新密码,这个可以写成脚本来修改ftp帐号的密码
echo newpasswd | ftpasswd –passwd –change-password –file=/etc/proftpd.passwd –name=newphp –stdin
工具ftpquota示列
#建立空间大小配额表
ftpquota –table-path=/etc/proftpd.quota –create-table –type=limit
#添加用户tiankun的空间使用配额,大小为2G
ftpquota –table-path=/etc/proftpd.quota –add-record –type=limit
–bytes-upload=2 –units=Gb –limit-type=hard –name=tiankun –quota-type=user
#删除用户tiankun的ftp空间配额限制
ftpquota –table-path=/etc/proftpd.quota –delete-record –type=limit
本文原创,转载请注明来自:http://www.newphp.net/contents/165-configure-and-install-proftpd
暂时没有评论!