安装配置ProFTPd

运维 系统运维
如何安装配置ProFTPd呢?ProFTPd安装(Professional FTP daemon)是针对Wu-FTP的弱项而开发的。不仅具有安全性,而且还Wu-FTP没有的特点。比如,能以Stand-alone、xinetd 等 模式运行。本文主要讲的是安装配置ProFTPd 的过程

  1 下载proftpd

  地址:www.proftpd.org。这里我们下载了1.2.9版本

  [code:1:de92f96787] wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.9.tar.gz

  [/code:1:de92f96787]

 2 安装proftpd

  切换到下载目录,假设为/tmp/proftpd,然后

  [code:1:de92f96787] tar zxvf proftpd-1.2.9.tar.gz //解压

  1.   cd proftpd-1.2.9  
  2.  
  3.   ./configure --prefix=/var/proftpd --sysconfdir=/etc //设置安装目录/var/proftpd,配置文件目录/etc  
  4.  
  5.   make  
  6.  
  7.   make install  
  8.  
  9.   [/code:1:de92f96787]  
  10.  

  3 新建ftp专用帐号

  就是上面目的中提到的那个专用帐号,这里以skate/skate(u/p)为例。

  [code:1:de92f96787] groupadd skate

  useradd skate -g skate -d /var/ftp -s /sbin/nologin //设置/var/ftp目录为ftp的目录

  passwd skate //设置skate用户的密码

  mkdir /var/ftp/upload

  chown skate.skate /var/ftp/upload //设置upload目录skate用户可写

  [/code:1:de92f96787]

  4 设置proftpd

  proftpd的配置文件就一个,就是/etc/proftpd.conf

  [code:1:de92f96787] vi /etc/proftpd.conf //打开proftpd.conf

  [/code:1:de92f96787]

  [code:1:de92f96787]

  ####具体配置如下######

  ServerName "Test ftp server..."

  ServerType standalone

  DefaultServer on

  #端口

  Port 21

  Umask 022

  #最大线程数

  MaxInstances 30

  User skate

  Group skate

  #DNS反查

  UseReverseDNS off

  IdentLookups off

  #最大尝试连接次数

  MaxLoginAttempts 3

  #每用户线程

  MaxClientsPerHost 2

  #最大用户数

  MaxClients 20

  DirFakeUser On skate

  DirFakeGroup On skate

  DeferWelcome On

  #日志文件位置

  SystemLog /var/log/proftpd.log

  ServerIdent off

  #限制skate组的skate用户登录时不能切换到其他目录(只能呆在他的home目录)

  DefaultRoot ~ skate,skate

  #设置只允许192.168.0的用户登录

  #

  #Order allow,deny

  #Allow from 192.168.0.

  #Deny from all

  #

  #设置只允许skate用户登录,否则系统用户也可以登录ftp

  #

  #Order allow,deny

  #DenyUser !skate

  #

  #开起全盘的写权限

  AllowOverwrite on

  AllowStoreRestart on

  #允许FXP

  # AllowForeignAddress on

  AllowAll

  #设置skate用户在upload的限制

  #DELE删除权限

  #RNFR RNTO重命名权限

  #RMD XRMD移动目录权限

  DenyUser skate

  #####结束######

  [/code:1:de92f96787]

  编辑完以后按Esc,然后输入:x保存。

  5 启动ProFTPd服务

  编辑一个启动脚本(这个是从网上copy的,不是我写的,感谢那个写这个脚本的人,很好用,thx)

  1.   [code:1:de92f96787] vi /etc/rc.d/init.d/proftpd[/code:1:de92f96787]  
  2.  
  3.   [code:1:de92f96787]  
  4.  
  5.   #####脚本内容开始########  
  6.  
  7.   #!/bin/sh  
  8.  
  9.   #  
  10.  
  11.   # Startup script for ProFTPD  
  12.  
  13.   #  
  14.  
  15.   # chkconfig: 345 85 15  
  16.  
  17.   # description: ProFTPD is an enhanced FTP server with \  
  18.  
  19.   # a focus toward simplicity, security, and ease of configuration. \  
  20.  
  21.   # It features a very Apache-like configuration syntax, \  
  22.  
  23.   # and a highly customizable server infrastructure, \  
  24.  
  25.   # including support for multiple 'virtual' FTP servers, \  
  26.  
  27.   # anonymous FTP, and permission-based directory visibility.  
  28.  
  29.   # processname: proftpd  
  30.  
  31.   # config: /etc/proftpd.conf  
  32.  
  33.   #  
  34.  
  35.   # By: Osman Elliyasa   
  36.  
  37.   # $Id: proftpd.init.d,v 1.7 2002/12/07 21:50:27 jwm Exp $  
  38.  
  39.   # Source function library.  
  40.  
  41.   . /etc/rc.d/init.d/functions  
  42.  
  43.   if [ -f /etc/sysconfig/proftpd ]; then  
  44.  
  45.   . /etc/sysconfig/proftpd  
  46.  
  47.   fi  
  48.  
  49.   #下面这行设置环境变量,注意设置好你的proftpd的安装目录  
  50.  
  51.   PATH="$PATH:/usr/local/sbin:/var/proftpd/bin:/var/proftpd/sbin" 
  52.  
  53.   # See how we were called.  
  54.  
  55.   case "$1" in  
  56.  
  57.   start)  
  58.  
  59.   echo -n "Starting proftpd: "  
  60.  
  61.   daemon proftpd $OPTIONS  
  62.  
  63.   echo  
  64.  
  65.   touch /var/lock/subsys/proftpd  
  66.  
  67.   ;;  
  68.  
  69.   stop)  
  70.  
  71.   echo -n "Shutting down proftpd: "  
  72.  
  73.   killproc proftpd  
  74.  
  75.   echo  
  76.  
  77.   rm -f /var/lock/subsys/proftpd  
  78.  
  79.   ;;  
  80.  
  81.   status)  
  82.  
  83.   status proftpd  
  84.  
  85.   ;;  
  86.  
  87.   restart)  
  88.  
  89.   $0 stop  
  90.  
  91.   $0 start  
  92.  
  93.   ;;  
  94.  
  95.   reread)  
  96.  
  97.   echo -n "Re-reading proftpd config: "  
  98.  
  99.   killproc proftpd -HUP  
  100.  
  101.   echo  
  102.  
  103.   ;;  
  104.  
  105.   suspend)  
  106.  
  107.   hash ftpshut >/dev/null 2>&1  
  108.  
  109.   if [ $? = 0 ]; then  
  110.  
  111.   if [ $# -gt 1 ]; then  
  112.  
  113.   shift  
  114.  
  115.   echo -n "Suspending with '$*' "  
  116.  
  117.   ftpshut $*  
  118.  
  119.   else  
  120.  
  121.   echo -n "Suspending NOW "  
  122.  
  123.   ftpshut now "Maintanance in progress"  
  124.  
  125.   fi  
  126.  
  127.   else  
  128.  
  129.   echo -n "No way to suspend "  
  130.  
  131.   fi  
  132.  
  133.   echo  
  134.  
  135.   ;;  
  136.  
  137.   resume)  
  138.  
  139.   if [ -f /etc/shutmsg ]; then  
  140.  
  141.   echo -n "Allowing sessions again "  
  142.  
  143.   rm -f /etc/shutmsg  
  144.  
  145.   else  
  146.  
  147.   echo -n "Was not suspended "  
  148.  
  149.   fi  
  150.  
  151.   echo  
  152.  
  153.   ;;  
  154.  
  155.   *)  
  156.  
  157.   echo -n "Usage: $0 {start|stop|restart|status|reread|resume"  
  158.  
  159.   hash ftpshut  
  160.  
  161.   if [ $? = 1 ]; then  
  162.  
  163.   echo '}'  
  164.  
  165.   else  
  166.  
  167.   echo '|suspend}'  
  168.  
  169.   echo 'suspend accepts additional arguments which are passed to ftpshut(8)'  
  170.  
  171.   fi  
  172.  
  173.   exit 1  
  174.  
  175.   esac  
  176.  
  177.   if [ $# -gt 1 ]; then  
  178.  
  179.   shift  
  180.  
  181.   $0 $*  
  182.  
  183.   fi  
  184.  
  185.   exit 0  
  186.  

  #######脚本结束#########

  [/code:1:de92f96787]

  按Esc,输入:x保存。

  然后添加到系统服务并启动

  [code:1:de92f96787]

  chkconfig --add profptd

  service proftpd start[/code:1:de92f96787]

  以后可以用service proftpd restart来重起proftpd。

  6 ProFTPd的一点体会

  看proftpd的文档翻译过的一句话:Finally, a special command is allowed which can be used to control login access: LOGIN Connection or login to

  the server. Applying a to this pseudo-command can be used to allow or deny initial connection or login to the context. It has no

  effect, and is ignored, when used in a context other than server config, or (i.e. using it in a context

  is meaningless).

  翻译下:最后,有一个用来限制登陆的特殊命令,就是LOGIN。在中用这个,可以禁止或者允许连接进来。但是,如果不在Server config,

  或者中使用的话,他将失去效用,或者说被忽略掉(比如在中使用就是无效的)。

  proftpd感觉还是比vsftp功能配置上好用一点,主要掌握好段基本上应用来说就没有问题了。

【编辑推荐】

  1. 用MySQL和Proftpd配置FTP服务器
  2. ProFTPD 下的五大问题
  3. Linux ProFTPd服务器配置(全)
  4. ProFTPD的配置文件proftpd.conf
  5. ProFTPD的启动与测试
  6. 手把手教你 配置ProFTPD服务器
  7. ProFTPd的启动
  8. 在图形界面下控制ProFTPD
责任编辑:zhaolei 来源: 网络转载
相关推荐

2010-03-29 14:48:58

CentOS系统

2011-03-08 10:10:37

Linuxproftpd

2011-02-24 14:47:48

ProFTPD

2011-03-03 13:43:11

2011-03-02 10:41:41

Vsftpd安装

2011-04-02 14:21:46

MRTG安装

2011-04-01 15:00:35

2011-02-25 17:48:52

2010-06-07 11:22:28

2011-03-03 13:00:21

2011-02-24 13:15:59

2011-02-22 10:08:46

ProFTPD配置

2011-02-23 11:15:21

DebianProFTPd

2011-02-22 09:50:01

2011-03-03 13:07:13

安装Proftpd

2011-02-25 09:44:51

怎样安装Proftpd

2011-03-30 15:05:40

MRTG安装

2011-03-25 15:01:44

Cacti安装

2011-11-08 21:55:58

MRTG 配置

2011-04-02 15:26:51

Cacti安装
点赞
收藏

51CTO技术栈公众号