自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

用Proftpd構(gòu)建Ttp服務(wù)器

運(yùn)維 系統(tǒng)運(yùn)維
用proftpd構(gòu)建ftp服務(wù)器:proftpd(Professional FTP daemon)是針對(duì)Wu-FTP的弱項(xiàng)而開發(fā)的。除了改進(jìn)的安全性,另外還具備許多Wu-FTP沒(méi)有的特點(diǎn)。比如,可以以Stand-alone、xinetd模式運(yùn)行等。ProFTP不僅配置很方便,而且還有MySQL和Quota模塊可供選擇。本文講述的是用proftpd構(gòu)建ftp服務(wù)器。

proftpd構(gòu)建ftp服務(wù)器:

  FTP服務(wù)被廣泛的應(yīng)用著,常見的,一些大學(xué)、組織、機(jī)構(gòu)等等,都有通過(guò)FTP服務(wù)器向外發(fā)布數(shù)據(jù)…但在這里,我們將要構(gòu)建的FTP服務(wù)器將主要針對(duì) 用于用戶更新自己的網(wǎng)站。也就是說(shuō),讓用戶(root除外)只可以訪問(wèn)自己的Web目錄(本站前面介紹的HTTP服務(wù)器構(gòu)建中以public_html為 例)。

  另外,為了避免通過(guò)平文傳輸時(shí),數(shù)據(jù)被截獲,從而泄漏隱私與密碼,我們采用TLS方式,加密FTP傳輸過(guò)程中的數(shù)據(jù),以確保安全。

  (構(gòu)建FTP服務(wù)器,您將有多種選擇,比如通過(guò)vsftpd等等FTP服務(wù)器軟件。但ProFTPD在一些方面,更能夠符合我們的實(shí)際條件,尤其對(duì)于ADSL方式接入網(wǎng)絡(luò)的服務(wù)器,ProFTPD能夠很好的應(yīng)對(duì)不斷變化的IP地址造成的問(wèn)題。)

  安裝 ProFTPD

  由于ProFTPD不存在于CentOS中yum的官方庫(kù)中,所以用yum安裝ProFTPD需要定義非官方的庫(kù)。請(qǐng)先確認(rèn)相應(yīng)非官方庫(kù)文件的存在。

  1.   [root@sample ~]# ls -l /etc/yum.repos.d/dag.repo  ← 確認(rèn)相應(yīng)庫(kù)文件的存在性  
  2.  
  3.   -rw-r--r-- 1 root root 143 Oct 1 21:33 /etc/yum.repos.d/dag.repo ← 確認(rèn)其存在(否則不能通過(guò)yum安裝ProFTPD)  
  4.  

  如果以上,dag.repo文件不存在,則不能通過(guò)yum安裝ProFTPD,需要定義非官方庫(kù)。定義非官方庫(kù)的方法請(qǐng)見 “CentOS的下載、安裝及初始環(huán)境設(shè)置”一節(jié)中yum的相關(guān)設(shè)置。而且,在此前提下也要保證所定義的dag.repo文件的語(yǔ)法的正確性。

  然后,通過(guò)yum來(lái)在線安裝ProFTPD。

  1.   [root@sample ~]# yum -y install proftpd  ← 安裝ProFTPD  
  2.  
  3.   Setting up Install Process  
  4.  
  5.   Setting up repositories  
  6.  
  7.   Reading repository metadata in from local files  
  8.  
  9.   Reducing Dag RPM Repository for Red Hat Enterprise Linux to included packages only  
  10.  
  11.   Finished  
  12.  
  13.   Parsing package install arguments  
  14.  
  15.   Resolving Dependencies  
  16.  
  17.   --> Populating transaction set with selected packages. Please wait.  
  18.  
  19.   ---> Downloading header for proftpd to pack into transaction set.  
  20.  
  21.   proftpd-1.2.10-10.2.el4.r 100% |=========================| 15 kB 00:00  
  22.  
  23.   ---> Package proftpd.i386 0:1.2.10-10.2.el4.rf set to be updated  
  24.  
  25.   --> Running transaction check  
  26.  
  27.   Dependencies Resolved  
  28.  

  =============================================================================

  1.   Package Arch Version Repository Size  
  2.  

  =============================================================================

  1.   Installing:  
  2.  
  3.   proftpd i386 1.2.10-10.2.el4.rf dag 699 k  
  4.  
  5.   Transaction Summary  
  6.  

  =============================================================================

  1.   Install 1 Package(s)  
  2.  
  3.   Update 0 Package(s)  
  4.  
  5.   Remove 0 Package(s)  
  6.  
  7.   Total download size: 699 k  
  8.  
  9.   Downloading Packages:  
  10.  
  11.   (1/1): proftpd-1.2.10-10. 100% |=========================| 699 kB 00:03  
  12.  
  13.   Running Transaction Test  
  14.  
  15.   Finished Transaction Test  
  16.  
  17.   Transaction Test Succeeded  
  18.  
  19.   Running Transaction  
  20.  
  21.   Installing: proftpd ######################### [1/1]  
  22.  
  23.   Installed: proftpd.i386 0:1.2.10-10.2.el4.rf  
  24.  
  25.   Complete!  
  26.  

#p#

  配置 ProFTPD

  然后,通過(guò)修改相應(yīng)配置文件配置ProFTPD。

  1.   [root@sample ~]# vi /etc/proftpd.conf  ← 修改ProFTPD的配置文件  
  2.  
  3.   ServerType        standalone   ← 找到這一行,在行首添加“#”  
  4.  
  5.   ↓  
  6.  
  7.   #ServerType        standalone   ← 變?yōu)榇藸顟B(tài),不使用常駐模式  
  8.  
  9.   #ServerType       inetd   ← 找到這一行,去掉行首的“#”  
  10.  
  11.   ↓  
  12.  
  13.   ServerType       inetd   ← 變?yōu)榇藸顟B(tài),通過(guò)超級(jí)服務(wù)器來(lái)啟動(dòng)ProFTPD  
  14.  
  15.   DefaultRoot        ~ !adm   ← 找到這一行,將“ !adm”改為“/public_html !wheel”  
  16.  
  17.   ↓  
  18.  
  19.   DefaultRoot        ~/public_html !wheel   ← 變?yōu)榇藸顟B(tài),使除wheel組用戶的根目錄為public_html  
  20.  

  找到TLS設(shè)置的語(yǔ)句群,如下:

  1.   # TLS  
  2.  
  3.   # Explained at http://www.castaglia.org/proftpd/modules/mod_tls.html  
  4.  

  ----------------------------------------------------------------

  1.   #TLSEngine         on  
  2.  
  3.   #TLSRequired        on  
  4.  
  5.   #TLSRSACertificateFile   /usr/share/ssl/certs/proftpd.pem  
  6.  
  7.   #TLSRSACertificateKeyFile /usr/share/ssl/certs/proftpd.pem  
  8.  
  9.   #TLSCipherSuite      ALL:!ADH:!DES  
  10.  
  11.   #TLSOptions        NoCertRequest  
  12.  
  13.   #TLSVerifyClient       off  
  14.  
  15.   ##TLSRenegotiate     ctrl 3600 data 512000 required off timeout 300  
  16.  
  17.   #TLSLog           /var/log/proftpd/tls.log  
  18.  

  ----------------------------------------------------------------

  ↓將以上水平線間部分的語(yǔ)句,每行行首的“#”都去掉,變?yōu)橄旅嫠骄€間的狀態(tài):

  ----------------------------------------------------------------

  1.   TLSEngine          on  
  2.  
  3.   TLSRequired         on  ← 只允許TLS方式的連接(如果將on改為off,普通方式也被允許)  
  4.  
  5.   TLSRSACertificateFile    /usr/share/ssl/certs/proftpd.pem  
  6.  
  7.   TLSRSACertificateKeyFile  /usr/share/ssl/certs/proftpd.pem  
  8.  
  9.   TLSCipherSuite       ALL:!ADH:!DES  
  10.  
  11.   TLSOptions         NoCertRequest  
  12.  
  13.   TLSVerifyClient       off  
  14.  
  15.   #TLSRenegotiate      ctrl 3600 data 512000 required off timeout 300  
  16.  
  17.   TLSLog            /var/log/proftpd/tls.log  
  18.  

  ----------------------------------------------------------------

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

  1.   ExtendedLog        /var/log/proftpd/access.log WRITE,READ default  ← 記錄連接日志到相應(yīng)日志文件  
  2.  
  3.   ExtendedLog        /var/log/proftpd/auth.log AUTH auth  ← 記錄認(rèn)證日志到相應(yīng)日志文件  
  4.  
  5.   MasqueradeAddress    digeast.no-ip.info  ← 定義服務(wù)器域名  
  6.  
  7.   PassivePorts        50000 50030  ← 為PASV模式連接時(shí)指定端口號(hào)(1024以后存在的任意端口號(hào))  
  8.  
  9.   然后,為服務(wù)器建立證書。  
  10.  
  11.   [root@sample ~]# cd /usr/share/ssl/certs  ← 進(jìn)入相應(yīng)的目錄  
  12.  
  13.   [root@sample certs]# make proftpd.pem  ← 建立服務(wù)器證書  
  14.  
  15.   umask 77 ; \  
  16.  
  17.   PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \  
  18.  
  19.   PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \  
  20.  
  21.   /usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 ; \  
  22.  
  23.   cat $PEM1 > proftpd.pem ; \  
  24.  
  25.   echo "" >> proftpd.pem ; \  
  26.  
  27.   cat $PEM2 >> proftpd.pem ; \  
  28.  
  29.   rm -f $PEM1 $PEM2  
  30.  
  31.   Generating a 1024 bit RSA private key  
  32.  
  33.   .........++++++  
  34.  
  35.   ............++++++  
  36.  
  37.   writing new private key to '/tmp/openssl.sG3126'  
  38.  

  -----

  1.   Country Name (2 letter code) [GB]:CN  ← 輸入國(guó)家簡(jiǎn)寫  
  2.  
  3.   State or Province Name (full name) [Berkshire]:Hei Long Jiang  ← 輸入省份  
  4.  
  5.   Locality Name (eg, city) [Newbury]:Harbin  ← 輸入城市  
  6.  
  7.   Organization Name (eg, company) [My Company Ltd]:www.centospub.com  ← 輸入組織名(任意)  
  8.  
  9.   Organizational Unit Name (eg, section) []:  ← 直接回車跳過(guò)  
  10.  
  11.   Common Name (eg, your name or your server's hostname) []:www.centospub.com   ← FTP服務(wù)器名反饋  
  12.  
  13.   Email Address []:yourname@yourserver.com  ← 輸入E-mail地址  
  14.  

#p#

  啟動(dòng) ProFTPD

  啟動(dòng)之前,先對(duì)超級(jí)服務(wù)器的ProFTPD的啟動(dòng)腳本做一些修改。

  1.   [root@sample certs]# vi /etc/xinetd.d/xproftpd  ← 編輯ProFTPD啟動(dòng)腳本  
  2.  
  3.   log_on_success += DURATION USERID  ← 找到此行,將“DURATION USERID”改為“HOST PID”  
  4.  
  5.   ↓  
  6.  
  7.   log_on_success += HOST PID   ← 變?yōu)榇藸顟B(tài),防止登錄時(shí)要等待30秒  
  8.  
  9.   log_on_failure += USERID  ← 找到此行,將“USERID”改為“HOST”  
  10.  
  11.   ↓  
  12.  
  13.   log_on_failure += HOST   ← 變?yōu)榇藸顟B(tài),防止登錄時(shí)要等待30秒  
  14.  
  15.   disable = yes  ← 找到此行,將yes改為no  
  16.  
  17.   ↓  
  18.  
  19.   disable = no   ← 變?yōu)榇藸顟B(tài),讓ProFTPD通過(guò)超級(jí)服務(wù)器啟動(dòng)  
  20.  

  然后,通過(guò)重新啟動(dòng)超級(jí)服務(wù)器間接啟動(dòng)ProFTPD。

  1.   [root@sample certs]# chkconfig xproftpd on  ← 設(shè)置ProFTPD自啟動(dòng)  
  2.  
  3.   [root@sample certs]# chkconfig --list xproftpd  ← 查看ProFTPD自啟動(dòng)  
  4.  
  5.   xproftpd on  ← 確認(rèn)為on的狀態(tài)就OK  
  6.  
  7.   [root@sample certs]# /etc/rc.d/init.d/xinetd restart  ← 重新啟動(dòng)超級(jí)服務(wù)器  
  8.  
  9.   Stopping xinetd:                [ OK ]  
  10.  
  11.   Starting xinetd:                 [ OK ]  
  12.  

  連接到FTP服務(wù)器

  當(dāng)我們成功的啟動(dòng)了FTP服務(wù)之后,就可以通過(guò)客戶端軟件連接到服務(wù)器進(jìn)行文件的上傳和下載了。但由于,本站介紹的方法,把安全、傳輸?shù)谋C苄苑旁诹?***位,這也就使得好多不支持TSL的FTP軟件無(wú)法連接到服務(wù)器。支持TSL的FTP客戶端軟件,比較有代表性的有Staff-FTP, SmartFTP。本站將以SmartFTP為例(下一節(jié)),介紹如何從客戶端通過(guò)FTP連接到服務(wù)器的方法。

【編輯推薦】

  1. 用MySQL和Proftpd配置FTP服務(wù)器
  2. ProFTPD 下的五大問(wèn)題
  3. Linux ProFTPd服務(wù)器配置(全)
  4. ProFTPD的配置文件proftpd.conf
  5. ProFTPD的啟動(dòng)與測(cè)試
  6. 手把手教你 配置ProFTPD服務(wù)器
  7. ProFTPd的啟動(dòng)
  8. 在圖形界面下控制ProFTPD
責(zé)任編輯:zhaolei 來(lái)源: CSDN網(wǎng)
相關(guān)推薦

2011-02-25 16:14:09

proftpdftp

2011-02-25 16:26:17

2011-02-23 09:01:37

2011-03-07 17:04:02

ProftpdFTP

2011-02-25 10:58:01

PROFTPD命令

2011-02-22 09:06:57

2011-02-22 15:09:32

ProFTPD服務(wù)器

2011-03-08 15:16:02

2011-02-24 14:14:22

PROFTPD命令

2011-02-23 12:18:28

DebianProFTPd服務(wù)器

2011-03-03 09:26:59

ProFTPD服務(wù)器管理

2011-02-22 10:55:13

ProFTPd服務(wù)器配置

2011-02-23 10:18:51

CentosProFTPD

2011-03-03 09:40:58

2011-02-25 15:38:58

2009-04-23 18:17:31

LinuxFTP服務(wù)器

2011-02-22 17:42:26

2015-08-04 13:29:06

Fedoralinux

2011-02-16 10:11:49

Ubuntu 10.1服務(wù)器

2011-02-24 13:33:35

ProFTPDFTP
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)