码迷,mamicode.com
首页 > 其他好文 > 详细

pure-ftp脚本

时间:2016-04-15 23:19:35      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:pure-ftp脚本

#/bin/bash

#create the work in 2016-4-15

#install ftp

check_ok() {

if [ $? != "0" ];then echo -e "\033[32m the commond is error\033[3m"

exit 0

else

echo -e "\033[32 the commond is ok\033[0m"

fi

}

#check the wall

iptables -F && servic iptables save

#check the selinux

seln="getenforce"

if [ $seln != "Disabled" ]; then sed -i ‘s#^SELINUX=\.*#SELINUX=disabled‘ /etc/selinux/config 

fi

#install ftp

cd /usr/local/src

[ -f pure-ftpd-1.0.42.tar.bz2 ] || wget -c  wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.bz2

[ -d pure-ftpd-1.0.42 ] && rm -rf pure-ftpd-1.0.42

tar jxf pure-ftpd-1.0.42.tar.bz2 && check_ok && cd pure-ftpd-1.0.42

./configure \

--prefix=/usr/local/pureftpd \

--without-inetd \

--with-altlog \

--with-puredb \

--with-throttling \

--with-peruserlimits  \

--with-tls

check_ok

make && check_ok && make install && check_ok

cd configuration-file && mkdir -p /usr/local/pureftpd/etc/ && cp pure-ftpd.conf    /usr/local/pureftpd/etc/pure-ftpd.conf && cp pure-config.pl    /usr/local/pureftpd/sbin/pure-config.pl && chmod 755    /usr/local/pureftpd/sbin/pure-config.pl && cd /usr/local/pureftpd/etc/ && >pure-ftpd.conf

cat >pure-ftpd.conf<<EOF

ChrootEveryone              yes

BrokenClientsCompatibility  no

MaxClientsNumber            50

Daemonize                   yes

MaxClientsPerIP             8

VerboseLog                  no

DisplayDotFiles             yes

AnonymousOnly               no

NoAnonymous                 no

SyslogFacility              ftp

DontResolve                 yes

MaxIdleTime                 15

PureDB                        /usr/local/pureftpd/etc/pureftpd.pdb

LimitRecursion              3136 8

AnonymousCanCreateDirs      no

MaxLoad                     4

AntiWarez                   yes

Umask                       133:022

MinUID                      100

AllowUserFXP                no

AllowAnonymousFXP           no

ProhibitDotFilesWrite       no

ProhibitDotFilesRead        no

AutoRename                  no

AnonymousCantUpload         no

PIDFile                     /usr/local/pureftpd/var/run/pure-ftpd.pid

MaxDiskUsage               99

CustomerProof              yes

EOF

/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf

check_ok


本文出自 “学习linux” 博客,请务必保留此出处http://10265013.blog.51cto.com/10255013/1764209

pure-ftp脚本

标签:pure-ftp脚本

原文地址:http://10265013.blog.51cto.com/10255013/1764209

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!