部署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登入】