ProFTPD 构建 FTP

安装 proftp

 

yum -y install proftpd

 

配置文件

 

vi /etc/proftpd.conf  (修改下列信息)

 

[root@sample ~]# vi /etc/proftpd.conf  ← 修改ProFTPD的配置文件

ServerType        standalone   ← 找到这一行,在行首添加“#”
 ↓
#ServerType        standalone   ← 变为此状态,不使用常驻模式

#ServerType       inetd   ← 找到这一行,去掉行首的“#”
 ↓
ServerType       inetd   ← 变为此状态,通过超级服务器来启动ProFTPD

DefaultRoot        ~ !adm   ← 找到这一行,将“ !adm”改为“/public_html !wheel”
 ↓
DefaultRoot        ~/public_html !wheel   ← 变为此状态,使除wheel组用户的根目录为public_html

找到TLS设置的语句群,如下:
# TLS
# Explained at http://www.castaglia.org/proftpd/modules/mod_tls.html
----------------------------------------------------------------
#TLSEngine         on
#TLSRequired        on
#TLSRSACertificateFile   /usr/share/ssl/certs/proftpd.pem
#TLSRSACertificateKeyFile /usr/share/ssl/certs/proftpd.pem
#TLSCipherSuite      ALL:!ADH:!DES
#TLSOptions        NoCertRequest
#TLSVerifyClient       off
##TLSRenegotiate     ctrl 3600 data 512000 required off timeout 300
#TLSLog           /var/log/proftpd/tls.log
----------------------------------------------------------------

 ↓将以上水平线间部分的语句,每行行首的“#”都去掉,变为下面水平线间的状态:

----------------------------------------------------------------
TLSEngine          on
TLSRequired         on  ← 只允许TLS方式的连接(如果将on改为off,普通方式也被允许)
TLSRSACertificateFile    /usr/share/ssl/certs/proftpd.pem
TLSRSACertificateKeyFile  /usr/share/ssl/certs/proftpd.pem
TLSCipherSuite       ALL:!ADH:!DES
TLSOptions         NoCertRequest
TLSVerifyClient       off
#TLSRenegotiate      ctrl 3600 data 512000 required off timeout 300
TLSLog            /var/log/proftpd/tls.log
----------------------------------------------------------------

然后在配置文件的末尾填如下几行:

ExtendedLog        /var/log/proftpd/access.log WRITE,READ default  ← 记录连接日志到相应日志文件
ExtendedLog        /var/log/proftpd/auth.log AUTH auth  ← 记录认证日志到相应日志文件
MasqueradeAddress    digeast.no-ip.info  ← 定义服务器域名
PassivePorts        50000 50030  ← 为PASV模式连接时指定端口号(1024以后存在的任意端口号)

 

 

建立证书

进入证书目录

cd /usr/share/ssl/certs  (我的是/etc/pki/tls/certs)

 

建立证书

make proftpd.pem

Country Name (2 letter code) [GB]:CN  ← 输入国家简写
State or Province Name (full name) [Berkshire]:Hei Long Jiang  ← 输入省份
Locality Name (eg, city) [Newbury]:Harbin  ← 输入城市
Organization Name (eg, company) [My Company Ltd]:www.centospub.com  ← 输入组织名(任意)
Organizational Unit Name (eg, section) []:  ← 直接回车跳过
Common Name (eg, your name or your server's hostname) []:www.centospub.com   ← FTP服务器名反馈
Email Address []:yourname@yourserver.com  ← 输入E-mail地址

 

编辑proftpd启动脚本

vi /etc/xinetd.d/xproftpd

log_on_success += DURATION USERID  ← 找到此行,将“DURATION USERID”改为“HOST PID”
 ↓
log_on_success += HOST PID   ← 变为此状态,防止登录时要等待30秒

log_on_failure += USERID  ← 找到此行,将“USERID”改为“HOST”
 ↓
log_on_failure += HOST   ← 变为此状态,防止登录时要等待30秒

disable = yes  ← 找到此行,将yes改为no
 ↓
disable = no   ← 变为此状态,让ProFTPD通过超级服务器启动

 

设置xproftpd自启动

 

chkconfig xproftpd on 

 

检查一下是否成功

 

chkconfig --list xproftpd (结果是0n就ok)

 

重启服务器

/etc/rc.d/init.d/xinetd restart

 

 

客户端连接测试一下,注意防火墙。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值