天天看點

ftp

ftp檔案傳輸伺服器

獨立方式啟動vsftp

分為三種:

vsftpd  安全性最高

wu-ftp  最早

proftp  wu-ftp的更新版

rpm -qa | grep vsftpd

vsftpd-2.0.1-5

service vsftpd start

/var/ftp      匿名登入位置

     ftp      匿名使用者

/home/主目錄  合法使用者登入位置

/etc/vsftpd.ftpusers  存放黑名單,裡面的使用者不能登入

/etc/vsftpd/vsftpd.conf  ftp主要配置檔案

anonymous_enable=yes  允許匿名使用者登入

local_enable=yes      允許合法使用者登入

write_enable=yes      允許合法使用者上傳

local_umask=022       上傳檔案的預設權限

dirmessage_enable=yes 切換使用者時是否有歡迎資訊

cd /var/ftp/pub

touch .message

echo "内容" > .message

xferlog_enable=yes    打開上傳下載下傳功能

xferlog_file=/var/log/vsftpd.log      存放日志檔案

connect-_from_port_20=yes 傳輸資料用20端口

ftpd_banner=内容    登入ftp時顯示資訊

或注釋上行,另加:

banner_file= ? 路徑    指定一個歡迎資訊檔案

在chroot_list_file=/etc/vsftpd.chroot_list後加一句

chroot_local_user=yes   把所有使用者鎖定在自己主目錄裡

listen=yes  以獨立方式啟動

tcp_wrappers=yes  ftp受以下兩個檔案控制

/etc/hosts.deny

/etc/hosts.allow

例:

vi /etc/hosts.deny

vsftpd:202.106.20.179:deny  這個ip不能登入

tcp_wrappers=no ftp不受以上兩個檔案控制

超級啟動vsftp:

service vsftp stop

chkconfig --level 35 vsftp off

cd /etc/xinetd.d

cp /usr/share/doc/vsftpd-2.0.1/vsftpd.xinetd /etc/xinetd.d/vsftpd

vi vsftpd

disable = no

vi /etc/vsftpd/vsftpd.conf

#listen=yes

#tcp_wrappers=yes

注釋以上兩行

/etc/rc.d/init.d/xinetd reload 重新整理超級服務

idle_session_timeout=600 會話逾時時間

data_connection_timeout=120

多長時間沒有傳輸資料,斷開接連

ascii_upload_enable=yes

ascii_download_enable=yes

允許上傳下載下傳ascii檔案

man vsftpd.conf

加到vsftpd.conf:

no_anon_password 匿名使用者是否要密碼? =yes 不要

anon_max_rate=? 匿名使用者最大上傳速度? =0不限制 機關:位元組

local_max_rate=? 本地使用者上傳速度?

listen_port= ?  設定ftp與非标準端口來工作,大于1024

max_clients=?  最多允許多少客戶機使用?

max_per_ip=?  同一個公網ip能登入ftp多少次?

匿名使用者允許上傳:

以獨立方式啟動

vi vsftpd.conf

放開最後兩行

rm vsftpd

在配置檔案裡加:

anon_upload_enable=yes 允許匿名使用者上傳

anon_mkdir_write_enable=yes 匿名使用者允許寫入

anon_other_write_enable=yes 讓匿名使用者具備其他寫入的權限

cd /var/ftp

mkdir abc

chmod a+w abc

繼續閱讀