|
3#
楼主 |
发表于 2011-6-9 09:26:34
|
只看该作者
然后在配置文件的末尾填如下几行:
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以后存在的任意端口号)
然后,为服务器建立证书。
[root@sample ~]# cd /usr/share/ssl/certs ← 进入相应的目录
[root@sample certs]# make proftpd.pem ← 建立服务器证书
umask 77 ; \
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
/usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 ; \
cat $PEM1 > proftpd.pem ; \
echo "" >> proftpd.pem ; \
cat $PEM2 >> proftpd.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
.........++++++
............++++++
writing new private key to '/tmp/openssl.sG3126'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
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
启动之前,先对超级服务器的ProFTPD的启动脚本做一些修改。
[root@sample certs]# vi /etc/xinetd.d/xproftpd ← 编辑ProFTPD启动脚本
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通过超级服务器启动
然后,通过重新启动超级服务器间接启动ProFTPD。
[root@sample certs]# chkconfig xproftpd on ← 设置ProFTPD自启动
[root@sample certs]# chkconfig --list xproftpd ← 查看ProFTPD自启动
xproftpd on ← 确认为on的状态就OK
[root@sample certs]# /etc/rc.d/init.d/xinetd restart ← 重新启动超级服务器
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
连接到FTP服务器
当我们成功的启动了FTP服务之后,就可以通过客户端软件连接到服务器进行文件的上传和下载了。但由于,本站介绍的方法,把安全、传输的保密性放在了第一位,这也就使得好多不支持TSL的FTP软件无法连接到服务器。支持TSL的FTP客户端软件,比较有代表性的有Staff-FTP, SmartFTP。 |
|