设定 xinetd 来启动 proftpd


ProFTPD 

图-ProFTPD

设定以 xinetd 来启动 proftpd

事實上,目前大部分的 FTP daemon 多是以 super daemon 來啟動的!所以這裡我們也直接以 xinetd 來設定 proftpd 吧!畢竟多了一層管理,會更安全的啊! ^_^!設定的方法也真是很簡單~只要編輯 xinetd 底下的 proftpd 以及 proftpd.conf 檔案裡面的一些內容即可! [root@test root]# vi /etc/xinetd.d/proftpd

  1. service ftp  
  2.  
  3. {  
  4.  
  5. disable = no  
  6.  
  7. flags = REUSE  
  8.  
  9. socket_type = stream  
  10.  
  11. wait = no  
  12.  
  13. user = root  
  14.  
  15. server = /usr/local/proftpd/sbin/proftpd  
  16.  
  17. server_args = -c /usr/local/proftpd/etc/proftpd.conf  
  18.  
  19. log_on_success += DURATION USERID  
  20.  
  21. log_on_failure += USERID  
  22.  
  23. }  
  24.  

# 上面的重點在於兩行粗體字的地方!尤其是 server =.. 那一行!

# 由於我們是使用 Tarball 安裝的,自然就以我們的檔案放置目錄為主,

# 如果您使用 RPM 安裝,這裡就不太相同囉!

# 另外,那個 server_args 後面接的則是設定檔的檔名咯!

[root@test root]# vi /usr/local/proftpd/etc/proftpd.conf

# 找到底下這個設定值:

ServerType standalone

Group nogroup

# 因為我們的系統預設並沒有 nogroup 這個群組,所以必須要將他改成

# 系統裡面有的群組才行吶!而伺服器啟動的方式有 super daemon 與

# stand alone ,所以:

  1. ServerType inetd  
  2.  
  3. Group nobody  
  4.  
  5. [root@test root]# /etc/rc.d/init.d/xinetd restart  
  6.  
  7. [root@test root]# netstat -tlnp  
  8.  
  9. tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 8483/xinetd  
  10.  

# 呵呵! 21 這個埠口出現了!理論上沒有問題,不過還是需要分析一下

# /var/log/messages 這個檔案的內容才行喔!

一般來說,我們還是比較建議使用 xinetd 的方式來啟動服務的,尤其是 FTP 之類的伺服器架設。在這個案例當中,我們就使用了 xinetd 來啟動,不過, proftpd 的設定檔 proftpd.conf 裡面就必須要規定好 ServerType 這個設定值,有兩個選擇:

standalone:表示獨立啟動的意思;

inetd:表示使用 super daemon ,不論是 inetd 或者是 xinetd 均使用這個設定值。

所以囉,這裡需要修訂好才行!然後就可以正確的來啟動囉!很簡單吧! ^_^!

通过鸟哥的文章,我们可以清楚的看出用设定 xinetd 这种方式來启动 proftpd 非常简单,希望大家都能学会他!

相关内容