CentOS Vsftpd配置文件服務(wù)要怎樣調(diào)整,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
為順平等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及順平網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站建設(shè)、成都網(wǎng)站制作、順平網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!
調(diào)整CentOS Vsftpd配置文件:
1.編輯CentOS Vsftpd配置文件前先備份
[root@KcentOS5 ~]cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.backup
2.編輯主CentOS Vsftpd配置文件Vsftpd.conf
[root@KcentOS5 ~]vi /etc/vsftpd/vsftpd.conf
這里我將原CentOS Vsftpd配置文件的修改完全記錄,凡是修改的地方我都會保留注釋原來的配置。其中加入我對每條配置項的認識,對于一些比較關(guān)鍵的配置項這里我做了我的觀點,并且原本英語的說明我也不刪除,供參考對比用。
Example config file /etc/vsftpd/vsftpd.conf
The default compiled in settings are fairly paranoid. This sample file
loosens things up a bit, to make the ftp daemon more usable.
Please see vsftpd.conf.5 for all compiled in defaults.
READ THIS: This example file is NOT an exhaustive list of vsftpd options.
Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
capabilities.
Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
anonymous_enable=NO
設(shè)定不允許匿名訪問
Uncomment this to allow local users to log in.
local_enable=YES設(shè)定本地用戶可以訪問。注意:主要是為虛擬宿主用戶,如果該項目設(shè)定為NO那么所有虛擬用戶將無法訪問。
Uncomment this to enable any form of FTP write command.
write_enable=YES
設(shè)定可以進行寫操作。
Default umask for local users is 077. You may wish to change this to 022,
if your users expect that (022 is used by most other ftpd's)
local_umask=022
設(shè)定上傳后文件的權(quán)限掩碼。
Uncomment this to allow the anonymous FTP user to upload files. This only
has an effect if the above global write enable is activated. Also, you will
obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
anon_upload_enable=NO
禁止匿名用戶上傳。
Uncomment this if you want the anonymous FTP user to be able to create
new directories.
anon_mkdir_write_enable=YES
anon_mkdir_write_enable=NO
禁止匿名用戶建立目錄。
Activate directory messages - messages given to remote users when they
go into a certain directory.
dirmessage_enable=YES
設(shè)定開啟目錄標語功能。
Activate logging of uploads/downloads.
xferlog_enable=YES
設(shè)定開啟日志記錄功能。
Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
設(shè)定端口20進行數(shù)據(jù)連接。
If you want, you can arrange for uploaded anonymous files to be owned by
a different user. Note! Using "root" for uploaded files is not
recommended!
chown_uploads=YES
chown_uploads=NO
設(shè)定禁止上傳文件更改宿主。
chown_username=whoever
You may override where the log file goes if you like. The default is shown
below.
xferlog_file=/var/log/vsftpd.log
設(shè)定CentOS Vsftpd配置的服務(wù)日志保存路徑。注意,該文件默認不存在。必須要手動touch出來,并且由于這里更改了CentOS Vsftpd配置的服務(wù)宿主用戶為手動建立的Vsftpd。必須注意給與該用戶對日志的寫入權(quán)限,否則服務(wù)將啟動失敗。
If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
設(shè)定日志使用標準的記錄格式。
You may change the default value for timing out an idle session.
idle_session_timeout=600
設(shè)定空閑連接超時時間,這里使用默認。將具體數(shù)值留給每個具體用戶具體指定,當(dāng)然如果不指定的話,還是使用這里的默認值600,單位秒。
You may change the default value for timing out a data connection.
data_connection_timeout=120
設(shè)定單次***連續(xù)傳輸時間,這里使用默認。將具體數(shù)值留給每個具體用戶具體指定,當(dāng)然如果不指定的話,還是使用這里的默認值120,單位秒。
It is recommended that you define on your system a unique user which the
ftp server can use as a totally isolated and unprivileged user.
nopriv_user=ftpsecure
nopriv_user=vsftpd
設(shè)定支撐CentOS Vsftpd服務(wù)的宿主用戶為手動建立的Vsftpd用戶。注意,一旦做出更改宿主用戶后,必須注意一起與該服務(wù)相關(guān)的讀寫文件的讀寫賦權(quán)問題。比如日志文件就必須給與該用戶寫入權(quán)限等。
Enable this and the server will recognise asynchronous ABOR requests. Not
recommended for security (the code is non-trivial). Not enabling it,
however, may confuse older FTP clients.
async_abor_enable=YES
設(shè)定支持異步傳輸功能。
By default the server will pretend to allow ASCII mode but in fact ignore
the request. Turn on the below options to have the server actually do ASCII
mangling on files when in ASCII mode.
Beware that on some FTP servers, ASCII support allows a denial of service
attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
predicted this attack and has always been safe, reporting the size of the
raw file.
ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
設(shè)定支持ASCII模式的上傳和下載功能。
You may fully customise the login banner string:
ftpd_banner=This Vsftp server supports virtual users ^_^
設(shè)定CentOS Vsftpd配置的登陸標語。
You may specify a file of disallowed anonymous e-mail addresses. Apparently
useful for combatting certain DoS attacks.
deny_email_enable=YES
(default follows)
banned_email_file=/etc/vsftpd/banned_emails
You may specify an explicit list of local users to chroot() to their home
directory. If chroot_local_user is YES, then this list becomes a list of
users to NOT chroot().
chroot_list_enable=YES
chroot_list_enable=NO
禁止用戶登出自己的FTP主目錄。
(default follows)
chroot_list_file=/etc/vsftpd/chroot_list
You may activate the "-R" option to the builtin ls. This is disabled by
default to avoid remote users being able to cause excessive I/O on large
sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES
ls_recurse_enable=NO
禁止用戶登陸FTP后使用"ls -R"的命令。該命令會對listens on IPv4 sockets. This directive cannot be used in conjunction
with the listen_ipv6 directive.
listen=YES
設(shè)定該CentOS Vsftpd服務(wù)工作在StandAlone模式下。順便展開說明一下,所謂StandAlone模式就是該服務(wù)擁有自己的守護進程支持,在ps -A命令下我們將可用看到vsftpd的守護進程名。如果不想工作在StandAlone模式下,則可以選擇SuperDaemon模式,在該模式下 vsftpd將沒有自己的守護進程,而是由超級守護進程Xinetd全權(quán)代理,與此同時,Vsftp服務(wù)的許多功能將得不到實現(xiàn)。
This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
sockets, you must run two copies of vsftpd whith two configuration files.
Make sure, that one of the listen options is commented !!
listen_ipv6=YES
pam_service_name=vsftpd
設(shè)定PAM服務(wù)下CentOS Vsftpd配置驗證文件名。因此,PAM驗證將參考/etc/pam.d/下的vsftpd文件配置。
userlist_enable=YES
設(shè)定userlist_file中的用戶將不得使用FTP。
tcp_wrappers=YES
設(shè)定支持TCP Wrappers。
KC: The following entries are added for supporting virtual ftp users.
以下這些是關(guān)于Vsftpd虛擬用戶支持的重要CentOS Vsftpd配置項目。默認Vsftpd.conf中不包含這些設(shè)定項目,需要自己手動添加配置。
guest_enable=YES
設(shè)定啟用虛擬用戶功能。
guest_username=overlord
指定虛擬用戶的宿主用戶。
virtual_use_local_privs=YES
設(shè)定虛擬用戶的權(quán)限符合他們的宿主用戶。
user_config_dir=/etc/vsftpd/vconf
設(shè)定虛擬用戶個人Vsftp的配置文件存放路徑。也就是說,這個被指定的目錄里,將存放每個Vsftp虛擬用戶個性的配置文件,一個需要注意的
地方就是這些配置文件名必須和虛擬用戶名相同。保存退出。
3.建立CentOS Vsftpd配置的日志文件,并更該屬主為Vsftpd的服務(wù)宿主用戶:
[root@KcentOS5 ~]touch /var/log/vsftpd.log
[root@KcentOS5 ~]chown vsftpd.vsftpd /var/log/vsftpd.log
4.建立虛擬用戶CentOS Vsftpd配置文件存放路徑:
[root@KcentOS5 ~]mkdir /etc/vsftpd/vconf/
看完上述內(nèi)容,你們掌握CentOS Vsftpd配置文件服務(wù)要怎樣調(diào)整的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!