- Rongsen.Com.Cn 版权所有 2008-2010 京ICP备08007000号 京公海网安备11010802026356号 朝阳网安编号:110105199号
- 北京黑客防线网安工作室-黑客防线网安服务器维护基地为您提供专业的
服务器维护
,企业网站维护
,网站维护
服务 - (建议采用1024×768分辨率,以达到最佳视觉效果) Powered by 黑客防线网安 ©2009-2010 www.rongsen.com.cn
作者:黑客防线网安网站维护基地 来源:黑客防线网安 浏览次数:0 |
一、软件下载
proftpd-1.3.0rc3.tar.gz
官方网站:http://www.proftpd.org/
镜像站点:http://www.proftpd.de/
二、解压缩、编译安装
# 解压缩
[root@localhost /]# tar zvxf proftpd-1.3.0rc3.tar.gz
[root@localhost /]#cd proftpd-1.3.0rc3
#编译安装(安装到/usr/local/proftpd目录下,可随意改变此目录)
[root@localhost proftpd-1.3.0rc3]# ./configure --prefix=/usr/local/proftpd
[root@localhost proftpd-1.3.0rc3]# make
[root@localhost proftpd-1.3.0rc3]# make install
三、建立FTP用户及相关权限(此处可根据实际需要配置)
1、建立用户组及用户
[root@localhost /]# groupadd ftpusers # 增加一个ftpusers组
[root@localhost /]# useradd -d /tools -g ftpusers -s /sbin/nologin softsoul
# 在ftpusers组增加一个名为softsoul的用户,目录设定为/tools,软件上传专用
[root@localhost /]# useradd -d /var/www/html -g ftpusers -s /sbin/nologin websoul # 在ftpusers组增加一个名为websoul的用户,目录设定为/var/www/html,WEB server专用
2、建立上传目录
# 如果你已经配置好WEB server,/var/www/html目录已经存在,只需如下修改目录权限(也可以在GUI界面下操作)
[root@localhost /]# chgrp -R ftpusers /var/www/html # 把wwwroot的归属组改为 ftpusers 组
[root@localhost /]# chmod -R 775 /var/www/html # 设置权限,ftpusers组对该文件夹具有读写执行的权限,其他用户只有读、执行权限(不可没有执行权限,否则web浏览不了)
[root@localhost /]# mkdir tools #在根目录下建立tools目录,作为软件目录
[root@localhost /]# chgrp -R ftpusers tools # 把tools的归属组也改为 ftpusers 组
[root@localhost /]# chmod -R 775 /tools # 设置权限
三、FTP server配置
[root@localhost /]# vi /usr/local/proftpd/etc/proftpd.conf
# 以下是偶的proftpd.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 "Soul's FTP Server"
ServerType standalone
DefaultServer on
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# 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 # 最多有30个proftpd的PID
MaxHostsPerUser 1 "Sorry, you may not connect more than one time" # 每个IP只允许一个连接
MaxClientsPerUser 1 "Only one such user at a time" # 每个帐户在每个客户端最多可以同时登陆1次
MaxClientsPerHost 1 "Sorry, you may not connect more than one time" # 同一个客户端只能最多1个帐号可以登陆
# 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 ~ ftpuser # 限制ftpusers组的用户在自己的目录下
# Normally, we want files to be overwriteable.
AllowOverwrite on # 是否允许覆盖
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# 设置只有ftpusers组的用户可以ftp登录
<limit LOGIN>
DenyALL
AllowGroup ftpuser
</limit>
# 设置帐号websoul拥有/var/www/html目录的所有权限
<directory /var/www/html>
<Limit all>
AllowUser websoul
</Limit>
</directory>
# 设置帐号softsoul拥有/tools目录的所有权限
<directory /tools>
<Limit all>
AllowUser softsoul
</Limit>
</directory>
# Limit the maximum number of anonymous logins
MaxClients 10 # 最多允许10个用户在线
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg # 当使用者登录时,则会显示 welcome.msg 中的欢迎词信息
DisplayFirstChdir .message # 当使用者转换目录,则会显示 .message 中的信息
ServerIdent off # 屏蔽服务器版本信息
MaxLoginAttempts 3 # 最大连接次数
WtmpLog on # 是否要把ftp记录在日志中,如果不想可以设置成off屏蔽掉log日志。
TimeoutIdle 600 # 客户端idel时间设置,默认就是600秒
AllowRetrieveRestart on # 下载时,允许断点续传(默认已有,可不设置)
AllowStoreRestart on # 上传时,允许断点续传
# 让proftp支持现在流行的FXP传输方式,默认是不支持的。
AllowForeignAddress on
PassivePorts 49152 65534 # 端口也可自己指定喜欢的
# 下面是关于匿名用户的相关配置,根据需要自己设定,因为我不需要匿名用户登录,所以全部屏敝掉了
# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
# <Anonymous ~ftp>
# User ftp
# Group ftp
# We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
# MaxClients 10
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayFirstChdir .message
# Limit WRITE everywhere in the anonymous chroot
# <Limit WRITE>
# DenyAll
# </Limit>
# </Anonymous>
我要申请本站:N点 | 黑客防线官网 | |
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479 |