善忘技术夹 Logo
善忘技术夹
技术文章 · 1522 阅读

CentOS安装proftpd方法(二)_三里亭_百度空间

From Evernote:


CentOS安装proftpd方法(二)_三里亭_百度空间

Clipped from: http://hi.baidu.com/lo%B1%F2%B1%F2%D3%D0%C0%F1ve/blog/item/c36d768c18861f1cb21bba0b.html

根据网上的一些网友的资料和自己需求且安装成功,把例子帖出来!

OS版本:CentOS 5.5
Proftpd版本:1.3.1a 下载地址 ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3a.tar.gz

一、下载软件:
www.proftpd.org上获取最新稳定版本软件包:proftpd-1.3.1a.tar.gz

二、安装软件:
具体步骤如下:
#cd /opt/soft #进入下载目录
#tar -zxvf proftpd-1.3.1a.tar.gz #解开软件包

./configure —prefix=/usr/local/proftpd

make

make install

三、建立相关用户
1、建立用户组
#/usr/sbin/groupadd ftpdown
#/usr/sbin/useradd -g ftpdown -d /opt -s /sbin/nologin ftpdown1
2、设置用户密码:
#passwd ftpdown1

四、proftpd配置文件解析

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 “ProFTPD Default Installation”
ServerType standalone
DefaultServer on

Port 21 is the standard FTP port.

Port 21 #端口设置

Don’t use IPv6 support by default.

UseIPv6 off

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

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 ~

Normally, we want files to be overwriteable.

AllowOverwrite on #允许覆写
AllowStoreRestart on #允许断点续上传
AllowRetrieveRestart on #允许断点续下载
AllowForeignAddress on #要允许 FXP ,则为on

Bar use of SITE CHMOD by default

AllowAll

五、试验
1、 试验前期所需了解知识,主要是limit的使用,用法如下:
CMD:Change Working Directory 改变目录
MKD:MaKe Directory 建立目录的权限
RNFR: ReName FRom 更改目录名的权限
DELE:DELEte 删除文件的权限
RMD:ReMove Directory 删除目录的权限
RETR:RETRieve 从服务端下载到客户端的权限
STOR:STORe 从客户端上传到服务端的权限
READ:可读的权限,不包括列目录的权限,相当于RETR,STAT等
WRITE:写文件或者目录的权限,包括MKD和RMD
DIRS:是否允许列目录,相当于LIST,NLST等权限,还是比较实用的
ALL:所有权限
LOGIN:是否允许登陆的权限

针对上面这个Limit所应用的对象,又包括以下范围
AllowUser 针对某个用户允许的Limit
DenyUser 针对某个用户禁止的Limit
AllowGroup 针对某个用户组允许的Limit
DenyGroup 针对某个用户组禁止的Limit
AllowAll 针对所有用户组允许的Limit
DenyAll 针对所有用户禁止的Limit

关于限制速率的参数为:
TransferRate STOR|RETR 速度(Kbytes/s) user 使用者

六.启动和关闭proftpd
开启proftpd
/usr/local/proftpd/sbin/proftpd
关闭proftpd
ps aux
netstat -apn|grep proftp
kill proftp这个进程数

七.在本地对设置的ftp测试
成功登录,有所有的权限!

没有设置关于配额和数据库连接,有相关的信息会在写出来
参考地址:http://blog.chinaunix.net/u3/90963/showart_1795360.html[blog.chinaunix.net/u3/90963/showart_1795360.html](http://blog.chinaunix.net/u3/90963/showart_1795360.html)