#./configure --prefix=/usr/local/proftpd #make && make install
4、修改配置文件参考如下,允许匿名登录下载文件,默认home目录为/data/patch:
cd /usr/local/proftpd/etc/ && mv proftpd.conf proftpd.conf_bak
echo > /usr/local/proftpd/etc/proftpd.conf << EOF
ServerName "ProFTPD server" ServerIdent on "FTP Server ready." ServerAdmin root@localhost DefaultServer on DefaultRoot ~ !adm UseReverseDNS off User nobody Group nobody MaxInstances 200 UseSendfile off
<Global> Umask 022 AllowOverwrite yes <Limit ALL SITE_CHMOD> AllowAll </Limit> </Global> <IfDefine ANONYMOUS_FTP> <Anonymous /data/patch> User ftp Group ftp AccessGrantMsg "Anonymous login ok, restrictions apply." UserAlias anonymous ftp MaxClients 100 "Sorry, max %m users -- try again later" DisplayLogin /welcome.msg DisplayChdir .message DirFakeUser on ftp DirFakeGroup on ftp <Limit SITE_CHMOD> DenyAll </Limit> <IfModule mod_vroot.c> <Directory "/*"> AllowOverwrite no <Limit ALL> DenyAll </Limit> <Limit DIRS> AllowAll </Limit> </Directory> <Directory "/patch"> AllowOverwrite no <Limit ALL> AllowAll </Limit> </Directory> </IfModule> WtmpLog off </Anonymous> </IfDefine>
1 个回复
nccloud
1、下载软件
#wet ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.7a.tar.gz
或百度网盘:https://pan.baidu.com/s/1cvGwrgNrG5e1O6nE2dl5Eg 提取码:cztq
2、解压
#tar -xvf proftpd-1.3.7a.tar.gz
3、编译安装
#cd /tmp/test/proftpd-1.3.7a/
#./configure --prefix=/usr/local/proftpd
#make && make install
4、修改配置文件参考如下,允许匿名登录下载文件,默认home目录为/data/patch:
cd /usr/local/proftpd/etc/ && mv proftpd.conf proftpd.conf_bak
echo > /usr/local/proftpd/etc/proftpd.conf << EOF
ServerName "ProFTPD server"
ServerIdent on "FTP Server ready."
ServerAdmin root@localhost
DefaultServer on
DefaultRoot ~ !adm
UseReverseDNS off
User nobody
Group nobody
MaxInstances 200
UseSendfile off
<Global>
Umask 022
AllowOverwrite yes
<Limit ALL SITE_CHMOD>
AllowAll
</Limit>
</Global>
<IfDefine ANONYMOUS_FTP>
<Anonymous /data/patch>
User ftp
Group ftp
AccessGrantMsg "Anonymous login ok, restrictions apply."
UserAlias anonymous ftp
MaxClients 100 "Sorry, max %m users -- try again later"
DisplayLogin /welcome.msg
DisplayChdir .message
DirFakeUser on ftp
DirFakeGroup on ftp
<Limit SITE_CHMOD>
DenyAll
</Limit>
<IfModule mod_vroot.c>
<Directory "/*">
AllowOverwrite no
<Limit ALL>
DenyAll
</Limit>
<Limit DIRS>
AllowAll
</Limit>
</Directory>
<Directory "/patch">
AllowOverwrite no
<Limit ALL>
AllowAll
</Limit>
</Directory>
</IfModule>
WtmpLog off
</Anonymous>
</IfDefine>
EOF
5、解决“USER ftp (Login failed): Invalid shell: '/sbin/nologin'”
#echo /sbin/nologin >> /etc/shells
6、启动服务
nohup /usr/local/proftpd/sbin/proftpd -DANONYMOUS_FTP