博主信息
博文 1
粉丝 0
评论 0
访问量 1093
相关推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
proftpd安装配置
老伍的博客
原创
1094人浏览过

【资料整理】proftpd安装配置

1)下载安装

wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4c.tar.gz

tar zxvf proftpd-1.3.4c.tar.gz

cd proftpd-1.3.4c

(启用配额模块,限制上传大小,如果重新configure,则需要先make distclean)

./configure --with-modules=mod_quotatab:mod_quotatab_file

make

make install

默认将安装在/usr/local/sbin 和/usr/local/bin目录下。

2)配置

开机启动:

cp contrib/dist/rpm/proftpd.init.d /etc/rc.d/init.d/proftpd

vim /etc/init.d/proftpd

找到下列内容:

# Make sure the binary is present.

[ -x /usr/sbin/proftpd ] || exit 5

更换为:

[ -x /usr/local/sbin/proftpd ] || exit 5

增加权限:

chmod 755 /etc/init.d/proftpd

chkconfig --add proftpd

chkconfig proftpd on

增加用户和组:

groupadd ftpuser1

useradd ftpuser1 -g ftpuser1 -d /home/ftpuser1 -s /sbin/nologin

passwd ftpuser1

增加上传目录:

mkdir -p /home/ftpuser1/upload

chown ftpuser1:ftpuser1 /home/ftpuser1/upload

检查IPTABLES是否开放FTP端口

修改配置文件:

vi /usr/local/etc/proftpd.conf 

[root@test120 ~]# cat /usr/local/etc/proftpd.conf

ServerName                      "ec-ftp-server"

ServerType                      standalone

DefaultServer                   on

Port                            21

UseIPv6                         off

Umask                           022

User                            ftpuser1

Group                           ftpuser1

DefaultRoot                     ~/upload

AllowOverwrite                  on

#AllowForeignAddress            on

#AllowRetrieveRestart           on

#AllowStoreRestart              on

MaxInstances                    30

#MAXConnectionRate              4

#MaxClients                     10 "Sorry, the maximum number of clients (%m) are already connected."

#MaxClientsPerUser              1 "Sorry, the maximum number of clients (%m) for this user are already connected." 

#MaxClientsPerHost              1 "Sorry, one client per host, please."

#MaxHostsPerUser                1

ServerIdent                     off

USEReverseDNS                   off

IDentLookups                    off

DirFakeUser                     on

DirFakeGroup                    on

DeferWelcome                    on

</ifmodule mod_quotatab.c>

    QuotaEngine                 on

    QuotaLog                    /var/log/quota.log

    </ifmodule mod_quotatab_file.c>

        QuotaLimitTable         file:/usr/local/etc/ftpquota.limittab

        QuotaTallyTable         file:/usr/local/etc/ftpquota.tallytab

    

    QuotaDirectoryTally         on

    QuotaDisplayUnits           Mb

    QuotaShowQuotas             on

    QuotaOptions                ScanOnLogin


SystemLog                       /var/log/proftpd.log

</limit site_chmod>

    DenyAll


</limit login>

    AllowUser ftpuser1

    DenyAll


</limit site_quota>

    AllowUser ftpuser1

    DenyAll


</directory ">

     </limit all>

        DenyAll

       

    </limit stor>

        AllowUser ftpuser1

        DenyAll

    


用户上传文件配额设置(限额5GB):

ftpquota -create -type=tally -table-path=/usr/local/etc/ftpquota.tallytab

ftpquota -create -type=limit -table-path=/usr/local/etc/ftpquota.limittab

ftpquota --type=limit --table-path=/usr/local/etc/ftpquota.limittab --add-record --quota-type=user --name=ftpuser1 --units=Gb --bytes-upload=5

启动proftpd:

service proftpd start

(如果是重新编译模块再安装,则要重启该服务以获得新功能,service proftpd restart)

3. 测试

ftp> open 1.2.3.4

连接到 1.2.3.4。

220 1.2.3.4 FTP server ready

用户(1.2.3.4:(none)): ftpuser1

331 Password required for ftpuser1

密码:

230 User ftpuser1 logged in

ftp> quote SITE QUOTA

200-The current quota for this session are [current/limit]:

 Name: ftpuser1

 Quota Type: User

 Per Session: False

 Limit Type: Hard

   Uploaded Mb:         0.00/5120.00

   Downloaded Mb:       unlimited

   Transferred Mb:      unlimited

   Uploaded files:      unlimited

   Downloaded files:    unlimited

   Transferred files:   unlimited

200 Please contact root@2.3.4.5 if these entries are inaccurate

ftp>

任务完成。


本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学