ProFTPD 下的五大問題
以下是我在平常使用ProFTPD的時候曾經遇到過的問題,寫出來一起學習、解答。
1、我安裝proftpd以后,出現了問題,我如何調試?
通過通過命令! /usr/local/sbin/proftpd -d9 -n啟動proftpd來進行調試,則proftp d就會將調試信息打印到consle上以供調試之用。
2、為什么我的proftpf啟動以后,匿名用戶不能登錄?
查看proftp配置文件/usr/local/etc/proftpd.conf,修改為(這里/home/ftp可以是任何希望匿名用戶登錄以后的當前根目錄,但是確保要使該目錄允許ftp用戶訪問),并且若部分的User指令指定的用戶為ftp用戶,則需要在配置文件中添加如下命令指示:
RequireValidShell off
3、我如何實現一個正常用戶登錄以后將其的訪問限定在某個目錄之下?
可以通過指令DefaultRoot來實現。例如若希望將ftpusers組的用戶限定在自己的home目錄下,則需要首先創建該組:
/usr/sbin/groupadd ftpusers
然后將用戶ideal加入到該組中:
usrmod -G ftpusers ideal
最后在在proftpd.conf文件中添加如下內容:
DefaultRoot ~ ftpusers
也可以限制用戶登錄以后僅僅訪問自己主目錄下的一個子目錄:
Default! Root ~/anoftp ftpusers
當然也可以將用戶限制在其他目錄之下,而不是自己的home目錄下:
DefaultRoot /tmp ftpusers
也可以限定一個用戶組的某些用戶被限制,而其他不作限制:
DefaultRoot ~ ftpusers,!empolyee
這個指令指示僅僅限制ftpusers組中的不是empolyee組的用戶進行限制。
4、我如何使用戶登陸時不顯示ftp服務器版本信息,以增強安全性?
在proftpd.conf中添加如下內容:
ServerIdent off
則再次登錄時,顯示如下內容:
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環境下如何設定虛擬主機?
可以通過指令:VirtualHost來實現,一個最簡單的例子:
ServerName "virtual FTP server"
若你僅僅希望通過匿名訪問某個虛擬主機,則使用如下! 的指令:
Serv erName "virtual FTP server"
DenyAll
User private
Group private
AllowAll
這樣192.168.2.35的這臺主機則僅僅允許匿名登錄。
筆者的proftpd.conf配置文件內容為:
# 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
以上就是我總結的在使用ProFTPD時遇到的五大共性的問題,希望能夠對大家有所幫助。
【編輯推薦】