日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

ProFtpd快速配置指南_Ftp服務(wù)器教程

編輯Tag賺U幣
教程Tag:ProFtpd添加

ProFTPD是一個(gè)Unix平臺(tái)上或是類Unix平臺(tái)上(如Linux, FreeBSD等)的FTP服務(wù)器程序,它是在自由軟件基金會(huì)的版權(quán)聲明(GPL)下開發(fā)、發(fā)布的免費(fèi)軟件,也就是說任何人只要遵守GPL版權(quán)聲明,都可以隨意修改源始碼。

ProFTPD設(shè)計(jì)目標(biāo)是實(shí)現(xiàn)一個(gè)安全且易于設(shè)定的FTP Server。目前Unix或類Unix平臺(tái)上FTP Server十分有限,最常使用的恐怕就是wu-ftpd了。雖然wu-ftpd有著極佳的效能同時(shí)也是一套很好的軟件,然而它卻欠缺了許多Win32平臺(tái)上FTP Server的一些特色,同時(shí)wu-ftpd過去也有不少的安全漏洞陸續(xù)被發(fā)現(xiàn)。ProFTPD的原創(chuàng)者本身就曾經(jīng)花非常多的時(shí)間尋找wu-ftpd的漏洞加以改進(jìn)并且增加許多功能。然而十分不幸的是,他很快地發(fā)現(xiàn)顯然wu-ftpd需要全部重新的改寫才能補(bǔ)足欠缺的設(shè)定能力以及缺乏的一些功能。ProFTPD不是從其它FTP Server的既有原始碼修改而產(chǎn)生的,相反的,它是完全獨(dú)立而完整、重新改寫的FTP Server。

ProFTPD的主要包括如下特點(diǎn):

* 單一主設(shè)置文件,包含許多指令以及其支配的組,? 耆際侵憊鄣納瓚āH綣魑歡訟pache Web Serve的設(shè)置不陌生的話相信一定會(huì)覺得十分容易操作設(shè)定。

* 每個(gè)目錄都可以定義一個(gè)".ftpaccess"設(shè)置文件,就如同Apache的".htaccess"文件一樣可以設(shè)定該目錄的存取權(quán)限。

* 可設(shè)定多個(gè)虛擬FTP server,而匿名FTP服務(wù)更是十分容易。

* 可根據(jù)系統(tǒng)的負(fù)載(load)選擇以單獨(dú)運(yùn)作(stand-alone)方式或是由inetd啟動(dòng)。

* 匿名FTP的根目錄不需要特定的目錄結(jié)構(gòu)、系統(tǒng)二進(jìn)制執(zhí)行文件或其它系統(tǒng)文件。

* ProFTPD不執(zhí)行任何外部程序以免造成安全漏洞。

* 具有隱藏目錄或隱藏文件,源自于Unix形式的檔案權(quán)限,或是user/group類型的檔案權(quán)限設(shè)定。

* 能夠以一般使用者在單獨(dú)運(yùn)作(stand-alone)模式下執(zhí)行,以減少某些藉由攻擊方式取得root權(quán)的可能性。注:此功能與Unix的操作系統(tǒng)有關(guān)。

* 支持系統(tǒng)記錄以及utmp/wtmp。

記錄的方式與wu-ftpd的標(biāo)準(zhǔn)完全兼容,也支持記錄內(nèi)容的延伸格式。

* 支持Shadow&! nbsp;password,包括了帳號(hào)使用期限設(shè)定的功能。

編譯和安裝

Proftpd提供了多種安裝格式,包括源代碼方式、RPM方式、deb方式(debian軟件包)等。本文主要討論源代碼方式的安裝。

從ftp.proftpd.net下載最新版本的proftpd-1.2.0rc3到Linux服務(wù)器上。然后按照如下步驟進(jìn)行處理:

[root@ftpd /]# cp proftpd-1.2.0rc3.tar.gz /usr/src/

[root@ftpd /]# cd /usr/src

[root@ftpd src]# tar xvfz proftpd-1.2.0rc3.tar.gz

[root@ftpd src]# cd proftpd-1.2.0rc3

[root@pftd proftpd-1.2.0rc3]# ./configure

[root@pftd p roftpd-1.2.0rc3]# make

[root@pftd proftpd-1.2.0rc3]# make install

到現(xiàn)在為止,你已經(jīng)完成了proftpd的編譯和安裝。并且在/usr/local/etc/目錄下有一個(gè)默認(rèn)的proftpd配置文件proftpd.conf。

啟動(dòng)測試

對(duì)于筆者的試驗(yàn)系統(tǒng)RedHat6.2來說,需要將該配置文件中:

Group nogrou! p

修改為:

Group nobody

因?yàn)閞edhat系統(tǒng)中nobody用戶屬于nobody組,而不是nogroup組。

若需要將proftpd設(shè)置為系統(tǒng)啟動(dòng)時(shí)自動(dòng)啟動(dòng)則通過如下命令拷貝啟動(dòng)文件:

[root@ftpd proftpd-1.2.0rc3]# cp ./contrib/dist/rpm/proftpd.init.d /etc/rc.d/init.d/proftpd

然后修改該腳本的可執(zhí)行屬性:

[root@ftpd /]# chmod +x /etc/rc.d/init.d/proftpd

然后編輯/etc/rc.d/init.d/functions:

修改

export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin" 為 export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin"

注:若將在運(yùn)行./cofigure命令時(shí)通過--prefix選項(xiàng)指定將proftpd安裝在/usr/sbin目! 錄下則不需要修改fuctions文件。

然后運(yùn)行命令:

[root@ftpd rc3.d]# chkconfig --level 35 proftpd on

則下次系統(tǒng)啟動(dòng)以后,proftpd將自動(dòng)啟動(dòng)。

最后,需要確保系統(tǒng)當(dāng)前沒有ftp服務(wù)器在運(yùn)行:

[root@ftpd /]# netstat -ln

若輸出中不包含

tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN

這樣的內(nèi)容則可以直接啟動(dòng)proftpd,否則需要關(guān)閉以前的ftpd服務(wù)器。對(duì)于一般的缺省Linux安裝來說,則需要通過以下的途徑來關(guān)閉ftp服務(wù)器:編輯/etc/inetd.conf文件,在ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a 一行前加上#:

#ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a 然后:

[root@ftpd ! /]# ps ax|grep inetd

350 ? S 0:00 inetd得到inetd的進(jìn)程號(hào) ,重新啟動(dòng)inetd進(jìn)程:

[root@ftpd /]# kill -HUP 350

然后通過如下命令啟動(dòng)proftpd:

[root@ftpd /]# /etc/rc.d/ init.d/proftpd start

這時(shí)候可以通過如下命令來測試proftpd是否正常運(yùn)行:

C:WINDOWS>ftp 192.168.2.33

Connected to 192.168.2.33.

220 ProFTPD 1.2.0rc3 Server (ProFTPD Default Installation)[ftpd.test.com.cn]

User (192.168.2.33:(none)): ideal

Password:

230 User ideal logged in.

ftp>

則現(xiàn)在你就擁有了一個(gè)安全可靠的ftp服務(wù)器。

FAQ

1、我安裝proftpd以后,出現(xiàn)了問題,我如何調(diào)試?

通過通過命令! /usr/local/sbin/proftpd -d9 -n啟動(dòng)proftpd來進(jìn)行調(diào)試,則proftp d就會(huì)將調(diào)試信息打印到consle上以供調(diào)試之用。

2、為什么我的proftpf啟動(dòng)以后,匿名用戶不能登錄?

查看proftp配置文件/usr/local/etc/proftpd.conf,修改(這里/home/ftp可以是任何希望匿名用戶登錄以后的當(dāng)前根目錄,但是確保要使該目錄允許ftp用戶訪問),并且若部分的User指令指定的用戶為ftp用戶,則需要在配置文件中添加如下命令指示:

RequireValidShell off

3、我如何實(shí)現(xiàn)一個(gè)正常用戶登錄以后將其的訪問限定在某個(gè)目錄之下?

可以通過指令DefaultRoot來實(shí)現(xiàn)。例如若希望將ftpusers組的用戶限定在自己的home目錄下,則需要首先創(chuàng)建該組:

/usr/sbin/groupadd ftpusers

然后將用戶ideal加入到該組中:

usrmod -G ftpusers ideal

最后在在proftpd.conf文件中添加如下內(nèi)容:

DefaultRoot ~ ftpusers

也可以限制用戶登錄以后僅僅訪問自己主目錄下的一個(gè)子目錄:

Default! Root ~/anoftp ftpusers

當(dāng)然也可以將用戶限制在其他目錄之下,而不是自己的home目錄下:

DefaultRoot /tmp ftpusers

也可以限定一個(gè)用戶組的某些用戶被限制,而其他不作限制:

DefaultRoot ~ ftpusers,!empolyee

這個(gè)指令指示僅僅限制ftpusers組中的不是empolyee組的用戶進(jìn)行限制。

4、我如何使用戶登陸時(shí)不顯示ftp服務(wù)器版本信息,以增強(qiáng)安全性?

在proftpd.conf中添加如下內(nèi)容:

ServerIdent off

則再次登錄時(shí),顯示如下內(nèi)容:

C:WINDOWS>ftp 192.168.2.33

Connected to 192.168.2.33.

220 ftpd.test.com.cn FTP server ready.

User (192.168.2.33:(none)):

5、在proftpd環(huán)境下如何設(shè)定虛擬主機(jī)?

可以通過指令:VirtualHost來實(shí)現(xiàn),一個(gè)最簡單的例子:

ServerName "virtual FTP server"

 

若你僅僅希望通過匿名訪問某個(gè)虛擬主機(jī),則使用如下! 的指令:

Serv erName "virtual FTP server"

DenyAll

 

User private

Group private

AllowAll

 

 

 

這樣192.168.2.35的這臺(tái)主機(jī)則僅僅允許匿名登錄。

筆者的proftpd.conf配置文件內(nèi)容為:

# 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 hxdye a user/group

# "nobody" and "ftp" for normal operation and anon.

ServerName &! quot;test.com.cn FTP Server"

ServerType standalone

DefaultServer on

# Port 21 is the standard FTP port.

Port 21

# 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&! nbsp;limit maximum number of processes per&nb sp;service

# (such as xinetd)

MaxInstances 30

RequireValidShell off

ServerIdent off

# Set the user and group that the server normally runs at.

User nobody

Group nobody

# Normally, we want files to be overwriteable.

AllowOverwrite on

 

# A basic anonymous configuration, no upload directories.

User ftp

Group ftp

# We want clients to be able to login with "anonymous" as well as "ftp"

UserAlias anonymous ftp

# Limit the maximum number of anonymous logins

MaxClients 10

# We ! ;want 'welcome.msg' displayed at login, and '.message' displayed

# in each newly chdired directory.

DisplayLogin welcome.msg

DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot

DenyAll

 

 

DefaultRoot ~ ftpusers

ServerName "virtual FTP server"

DenyAll

 

User private

Group private

AllowAll

 

 

 

來源:網(wǎng)絡(luò)搜集//所屬分類:Ftp服務(wù)器教程/更新時(shí)間:2012-06-21
相關(guān)Ftp服務(wù)器教程