【原创】pure-ftpd服务器搭建【支持UTF-8编码】

一、系统环境:


Red Hat Enterprise Linux Server release 5.8
2.6.18-308.el5

二、pure-ftpd服务器安装方式:


1,yum -y groupinstall ‘Development Tools’

2,cd /usr/local/

3,tar -xvf pure-ftpd-1.0.36.tar.gz

4, cd pure-ftpd-1.0.36

5,./configure –prefix=/usr –bindir=/usr/bin –sbindir=/usr/sbin –libexecdir=/usr/libexec –datadir=/usr/share –sysconfdir=/etc –sharedstatedir=/usr/com –localstatedir=/var –libdir=/usr/lib64 –includedir=/usr/include –infodir=/usr/share/info –mandir=/usr/share/man –with-virtualchroot –with-rfc2640 –with-everything

6,make

7,make install

8,vi /etc/init.d/pure-ftpd

!/bin/bash
 #
 Startup script for the pure-ftpd FTP Server  $Revision: 1.1 $
 #
 chkconfig: - 85 15
 description: Pure-FTPd is an FTP server daemon based upon Troll-FTPd
 processname: pure-ftpd
 pidfile: /var/run/pure-ftpd.pid
 config: /etc/pure-ftpd/pure-ftpd.conf
 Source function library.
 . /etc/init.d/functions
 Source networking configuration.
 . /etc/sysconfig/network
 Check that networking is configured.
 [ ${NETWORKING} = "no" ] && exit 0
 RETVAL=0
 prog="pure-ftpd"
 Path to the pure-ftp binaries.
 fullpath=/usr/sbin/pure-ftpd
 pureftpwho=/usr/sbin/pure-ftpwho
 pure_config=/etc/pure-ftpd/pure-ftpd.conf
 pure_launch_script=/usr/sbin/pure-config.pl
 start() {
         echo -n $"Starting $prog: "
         daemon "$pure_launch_script $pure_config --daemonize > /dev/null"
         RETVAL=$?
         [ $RETVAL = 0 ] && touch /var/lock/subsys/pure-ftpd
         echo
 }
 stop() {
         echo -n $"Stopping $prog: "
         killproc pure-ftpd
         RETVAL=$?
         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/pure-ftpd
         echo
 }
 See how we were called.
 case "$1" in
         start)
                 start
                 ;;
         stop)
                 stop
                 ;;
         restart)
                 stop
                 start
                 ;;
         reload)
         echo -n $"Reloading $prog: "
                 killproc pure-ftpd -HUP
                 RETVAL=$?
                 echo
                 ;;
         condrestart)
                 if [ -f /var/lock/subsys/pure-ftpd ] ; then
                         stop
                         # avoid race
                         sleep 3
                         start
                 fi
                 ;;
         status)
                 status pure-ftpd
                 RETVAL=$?
                 if [ -f $pureftpwho ] && [ $RETVAL -eq 0 ] ; then
                         $pureftpwho
                 fi
                 ;;
         *)
                 echo $"Usage: pure-ftpd {start|stop|restart|reload|condrestart|status}"
                 RETVAL=1
 esac
 exit $RETVAL

9,chmod +x /etc/init.d/pure-ftpd

10,mkdir /etc/pure-ftpd/

11,cp configuration-file/pure-ftpd.conf /etc/pure-ftpd/pure-ftpd.conf

12,cp configuration-file/pure-config.pl /usr/sbin/pure-config.pl

13,chmod 744 /etc/pure-ftpd/pure-ftpd.conf

14,chmod 755 /usr/sbin/pure-config.pl

15,chkconfig –levels 235 pure-ftpd on

16,/etc/init.d/pure-ftpd start

17,groupadd ftpgroup

18,useradd -g ftpgroup -d /dev/null -s /sbin/nologin ftpuser

19,vi /etc/pure-ftpd/pure-ftpd.conf # /PureDB 将前面的#号去掉

20, mkdir -p /data/ftp/kefu01

21,chown ftpuser.ftpgroup /data/ftp/kefu01

22,pure-pw useradd kefu01 -u 99 -g 99 -d /data/ftp/kefu01

23,/usr/local/pureftpd/bin/pure-pw mkdb

24,/etc/init.d/pure-ftpd restart

附录【关于配置文件的一些修改】

PUREFTPD ERROR: 530 SORRY, BUT I CAN'T TRUST YOU
这个错误码需要修改配置文件中的这个参加:
MinUID
pure-ftpd.conf这个文件中MinUID这个值需要,小于FTP服务启动的用户,在

/etc/passwd 中对应的值,比如用root用户启动了ftp.通常root用户在passwd中
值为11。故MinUID这个值需要配置为小于等于11。

参考链接:
http://www.lastme.com/linux/pureftpd-error-530-sorry-but-i-cant-trust-you/

三,关于需要让用户强制登录:


NoAnonymous yes //将这一项配置为yes就可以实现强制用户登录了
参考链接:
http://os.51cto.com/art/201102/246394.htm

未经允许不得转载:大自然的搬运工 » 【原创】pure-ftpd服务器搭建【支持UTF-8编码】

赞 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址