ProFTPD 下的五大問(wèn)題
以下是我在平常使用ProFTPD的時(shí)候曾經(jīng)遇到過(guò)的問(wèn)題,寫(xiě)出來(lái)一起學(xué)習(xí)、解答。
1、我安裝proftpd以后,出現(xiàn)了問(wèn)題,我如何調(diào)試?
通過(guò)通過(guò)命令! /usr/local/sbin/proftpd -d9 -n啟動(dòng)proftpd來(lái)進(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用戶訪問(wèn)),并且若部分的User指令指定的用戶為ftp用戶,則需要在配置文件中添加如下命令指示:
RequireValidShell off
3、我如何實(shí)現(xiàn)一個(gè)正常用戶登錄以后將其的訪問(wèn)限定在某個(gè)目錄之下?
可以通過(guò)指令DefaultRoot來(lái)實(shí)現(xiàn)。例如若希望將ftpusers組的用戶限定在自己的home目錄下,則需要首先創(chuàng)建該組:
/usr/sbin/groupadd ftpusers
然后將用戶ideal加入到該組中:
usrmod -G ftpusers ideal
最后在在proftpd.conf文件中添加如下內(nèi)容:
DefaultRoot ~ ftpusers
也可以限制用戶登錄以后僅僅訪問(wèn)自己主目錄下的一個(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ī)?
可以通過(guò)指令:VirtualHost來(lái)實(shí)現(xiàn),一個(gè)最簡(jiǎn)單的例子:
ServerName "virtual FTP server"
若你僅僅希望通過(guò)匿名訪問(wèn)某個(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 have 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
以上就是我總結(jié)的在使用ProFTPD時(shí)遇到的五大共性的問(wèn)題,希望能夠?qū)Υ蠹矣兴鶐椭?/p>
【編輯推薦】