vsftp 簡易部署使用

vsftp (Very Security Ftp

CentOS 6.2 32bit


參考配置:http://os.51cto.com/art/201008/221842.htm

http://os.51cto.com/art/201008/221633.htm 玩轉vsftpd服務器的四大高級配置--李洋

安裝:
[root@localhost ~]# yum search vsftpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
================================================ Matched: vsftpd ================================================
vsftpd.i386 : vsftpd - Very Secure Ftp Daemon
[root@localhost ~]#
 
配置文件說明:
[root@localhost pub]# grep -v "^#" /etc/vsftpd/vsftpd.conf | grep -v '^$'
anonymous_enable=YES                      允許匿名登錄
local_enable=YES
write_enable=YES                              給予寫權限
local_umask=022
anon_upload_enable=YES                    匿名用戶上傳
anon_mkdir_write_enable=YES           匿名賬號創建文件夾
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES              
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
 [root@Cacti8a pub]#


[root@localhost ftp]# ll
total 4
drwxr-xr-x. 2 root root 4096 Jun 17 15:03 pub
[root@localhost ftp]# chmod 1777 pub/
[root@localhost ftp]# ll
total 4
drwxrwxrwt. 2 root root 4096 Jun 17 15:03 pub
[root@localhost ftp]#
匿名用戶的下載目錄,此目錄需賦權根chmod 1777 pub(1爲特殊權限,使上載後無法刪除)

useradd ftp01 -s /sbin/nologin -d /data/ftp01/
建立ftp01賬號(不允許登錄系統),指定根目錄爲 /data/ftp01/

password ftp01   (配置賬號密碼)
:password
 
修改 /data/ftpshenq/ 目錄讀寫權限
chmod 1777  /data/ftpshenq/

啓動服務:
service vsftpd start
 
測試上傳下載文件,完成。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章