FTP的全稱是File (文件傳輸協議),就是專門用來傳輸文件的協議.它工作在OSI模型的第七層,即是應用層,使用TCP傳輸而不是UDP.這樣FTP客戶端和服務器建立連接前就要經過一個"三次握手"的過程.FTP服務還有一個非常重要的特點是它可以獨立于平臺.
LINUX下實現FTP服務的軟件很多,最常見的有,Wu-ftpd和等.Red Hat Linux中默認安裝的是.
通常,訪問FTP服務器時需要經過驗證,只有經過了FTP服務器的相關驗證,用戶才能訪問和傳輸文件.提供了3種ftp登錄形式:
(1)(匿名帳號)
使用是應用廣泛的一種FTP服務器.如果用戶在FTP服務器上沒有帳號,那么用戶可以以為用戶名,以自己的電子郵件地址為密碼進行登錄.當匿名用戶登錄FTP服務器后,其登錄目錄為匿名FTP服務器的根目錄/var/ftp.為了減輕FTP服務器的負載,一般情況下,應關閉匿名帳號的上傳功能.
(2)real(真實帳號)
real也稱為本地帳號,就是以真實的用戶名和密碼進行登錄,但前提條件是用戶在FTP服務器上擁有自己的帳號.用真實帳號登錄后,其登錄的目錄為用戶自己的目錄,該目錄在系統建立帳號時系統就自動創建.
(3)guest(虛擬帳號)
如果用戶在FTP服務器上擁有帳號,但此帳號只能用于文件傳輸服務,那么該帳號就是guest,guest是真實帳號的一種形式,它們的不同之處在于,geust登錄FTP服務器后,不能訪問除宿主目錄以外的內容。下面就對其詳細介紹.
一、安裝與啟動
先使用命令查看是否安裝.
可看到安裝了版本為2.2.2.如果沒有安裝可在桌面上選擇"應用程序"/"系統設置"添加/刪除應用程序"命令.來安裝FTP軟件包或者在命令行界面進行安裝都可.;
安裝和配置好軟件包后,需要啟動FTP服務器才能使用.啟動方法有以下兩種:
使用圖形化方式啟動,選擇"應用程序"/系統設置/服務器設置/服務.可看到,打上勾,開始啟動.;
使用命令行界面用命令啟動。
二、FTP相關配置文件說明
其相關配置文件有/etc//.conf, /etc/., /etc/.,在配置FTP服務器時,主要是修改這些文件中的相關語句。
1..conf文件說明
# file /etc//.conf
#
# The in are . This file
# up a bit, to make the ftp more .
# see .conf.5 for all in .
#
# READ THIS: This file is NOT an list of .
# read the .conf.5 page to get a full idea of 's
# .
#
# Allow FTP? ( - by if you this out).
=YES //是否允許登錄FTP服務器,默認是允許的.
#
# this to allow local users to log in.
=YES //是否允許本地用戶登錄FTP服務器,默認是允許
#
# this to any form of FTP write .
=YES //是否允許用戶具有在FTP服務器文件中執行寫的權限,默認是允許
#
# umask for local users is 077. You may wish to this to 022,
# if your users that (022 is used by most other ftpd's)
=022 //設置本地用戶的文件生成掩碼為022,默認是077
#
# this to allow the FTP user to files. This only
# has an if the above write is . Also, you will
# need to a by the FTP user.
#=YES
#
# this if you want the FTP user to be able to
# new .
#ble=YES //是否允許匿名賬戶在FTP服務器中創建目錄
#
# - given to users when they
# go into a .
=YES //激活目錄信息,當遠程用戶更改目錄時,將出現提示信息
#
# of /.
=YES //啟用上傳和下載日志功能
#
# Make sure PORT from port 20 (ftp-data).
=YES //啟用FTP數據端口的連接請求
#
# If you wantvsftpd 沒有寫權限, you can for files to be owned by
# a user. Note! Using "root" for files is not
# !
#=YES
#=
#
# You may where the log file goes if you like. The is shown
# below.
#=/var/log/.log //設置日志文件的文件名和存儲路徑,這是默認的
#
# If you want, you can have your log file in ftpd
=YES//是否使用標準的ftpd 日志文件格式
#
# You may the value for out an idle .
#=600 //設置空閑的用戶會話中斷時間,默認是10分鐘
#
# You may the value for out a data .
#out=120//設置數據連接超時時間vsftpd 沒有寫權限,默認是120秒.
#
# It is that you on your a user which the
# ftp can use as a and user.
#=
#
# this and the will ABOR . Not
# for (the code is non-). Not it,
# , may older FTP .
#=YES
#
# By the will to allow ASCII mode but in fact
# the . Turn on the below to have the do ASCII
# on files when in ASCII mode.
# that on e
# to your I/O , by the "SIZE /big/file" in
# ASCII mode.
# These ASCII are split into and you may wish
# to ASCII (to etc. from ),
# the DoS risk of SIZE and ASCII . ASCII be
# on the ..
#=YES
#e=YES //是否允許使用ASCII格式來上傳和下載文件
#
# You may fully the login :
#= to blah FTP .//在FTP服務器中設置歡迎登錄的信息.
#
# You may a file of e-mail .
# for DoS .
#=YES
# ( )
#=/etc/.
#
# You may an list of local users to () to their home
# . If is YES, then this list a list of
# users to NOT ().
#=YES //如果希望用戶登錄后不能切換到自己目錄以外的其它目錄,需要設置該項,如果設置=YES,那么只允許/etc/.中列出的用戶具有該功能.如果希望所有的本地用戶都執行者,可以增加一行:=YES
# ( )
#=/etc/.
#
# You may the "-R" to the ls. This is by
# to avoid users being able to cause I/O on large
# sites. , some FTP such as "ncftp" and ""
# the of the "-R" , so there is a case for it.
#=YES
= //設置PAM認證服務的配置文件名稱,該文件存放在/etc/pam.d/目錄下.
=YES //用戶列表中的用戶是否允許登錄FTP服務器,默認是不允許
# for mode
=YES //使 處于獨立啟動模式
=YES //使用作為主機訪問控制方式
2..文件說明
這個文件是用來記錄"不允許"登錄到FTP服務器的用戶,通常是一些系統默認的用戶.
下面是該文件中默認的不允許登錄的名單:
# Users that are not to login via ftp
root //默認情況下,root和它以下的用戶是不允許登錄FTP服務器的.可以將不允許登錄的用戶添加到這里來.但切記每個用戶都要單獨占用一行.
bin
adm
lp
sync
halt
news
uucp
games
3..文件說明
其實它的內容跟上面那個文件內容一樣,只是在系統對文件.conf 進行檢測時,會檢測到"=YES",因此這個文件必須存在.下面是這個文件的內容。
#
# If =NO, only allow users in this file
# If =YES (), never allow users in this file, and
# do not even for a .
# Note that the pam also /etc/.
# for users that are .
root
bin
adm
lp
sync
halt
news
uucp
games
?