天天看點

proftp搭建linux的ftp服務

部署ftp伺服器

首先建立下載下傳目錄

mkdir  -p /home/down

然後下載下傳proftpd源碼包

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

接下來我們就來安裝proftpd服務

tar -zxvf proftpd-1.3.2.tar.gz  #解壓源碼

cd proftpd-1.3.2   #進入源碼包

./configure --prefix=/home/ftp/proftpd  #編譯安裝路徑

make && make install  #編譯二進制碼和安裝

cp contrib/dist/rpm/proftpd.init.d /etc/init.d/proftpd #【拷貝啟動檔案,是為了友善用service proftpd start 來啟動ftp服務】

chmod o+x /etc/rc.d/init.d/proftpd #給啟動腳本執行權限

vi /etc/init.d/proftpd #修改啟動檔案錯誤的路徑

######################################################

#!/bin/sh

#

# Startup script for ProFTPD

# chkconfig: 345 85 15

# description: ProFTPD is an enhanced FTP server with \

#              a focus toward simplicity, security, and ease of configuration. \

#              It features a very Apache-like configuration syntax, \

#              and a highly customizable server infrastructure, \

#              including support for multiple 'virtual' FTP servers, \

#              anonymous FTP, and permission-based directory visibility.

# processname: proftpd

# config: /home/ftp/proftpd/etc/proftpd.conf  #路徑如果不正确需要修改

# By: Osman Elliyasa <[email protected]>

# $Id: proftpd.init.d,v 1.7 2002/12/07 21:50:27 jwm Exp $

# Source function library.

. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/proftpd ]; then

      . /etc/sysconfig/proftpd

fi

PATH="$PATH:/home/quacor/proftpd/sbin"  #路徑不正确需要修改

#########################################################

一下是proftp.conf的配置,安裝自己需求修改

# This is a basic ProFTPD configuration file (rename it to

# 'proftpd.conf' for actual use.  It establishes a single server

# and a single anonymous login.  It assumes that you have a user/group

# "nobody" and "ftp" for normal operation and anon.

ServerName                      "www FTP"

ServerType                      standalone

DefaultServer                   on

# Port 21 is the standard FTP port.

Port                            21    #制定端口

# Don't use IPv6 support by default.

UseIPv6                         off #關閉ip6

# Umask 022 is a good standard umask to prevent new dirs and files

# from being group and world writable.

Umask                           002 #給上傳檔案權限

# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd).

MaxInstances                    30 #最大連接配接數

# Set the user and group under which the server will run.

User                            nobody  #指定啟動使用者

Group                           nobody#制定啟動組

# To cause every FTP user to be "jailed" (chrooted) into their home

# directory, uncomment this line.

DefaultRoot ~ !admin#指定能通路全部伺服器資源的權限

# Normally, we want files to be overwriteable.

AllowOverwrite          on  #權限設定

UseReverseDNS           off

IdentLookups            off

# Bar use of SITE CHMOD by default

<Limit SITE_CHMOD>

  DenyAll

</Limit>

####################################################

建立ftp伺服器使用者最好不要給shell權限,推薦用一下指令建立使用者

useradd -m  -d /down/ftp -g ftpm -s /sbin/nologin ftp123【本指令不見使用者目錄,制定上傳下載下傳目錄,指定上傳組,拒絕shell登入】

繼續閱讀