vsftpd能夠對每一個用戶特別限制.
只要給那個用戶創建一個設置文件,而後在文件裏設置
在vsftpd.conf里加
user_config_dir=/etc/vsftpd/vsftpd_user_conf,這是文件夾.固然你能夠本身選把用戶文件放在哪
在此文件夾裏新建一個文件,跟用戶名相同.VSFTPD會比對用戶名和用戶設置文件.
在文件里加
local_root=PATH to directory就能夠更改用戶的home directory
local_max_rate=XXXX就能夠限制此用戶的帶寬.
cmds_allowed=XXXXX, 此用戶能夠使用的指令
<strong># ABOR - abort a file transfer</strong>
# CWD - change working directory
<strong># DELE - delete a remote file</strong>
# LIST - list remote files
# MDTM - return the modification time of a file
<strong># MKD - make a remote directory</strong>
# NLST - name list of remote directory
# PASS - send password
# PASV - enter passive mode
# PORT - open a data port
# PWD - print working directory
# QUIT - terminate the connection
<strong># RETR - retrieve a remote file</strong>
# RMD - remove a remote directory
# RNFR - rename from
# RNTO - rename to
# SITE - site-specific commands
# SIZE - return the size of a file
# STOR - store a file on the remote host
# TYPE - set transfer type
# USER - send username
#
# less common commands:
# ACCT* - send account information
# APPE - append to a remote file
# CDUP - CWD to the parent of the current directory
# HELP - return help on using the server
# MODE - set transfer mode
# NOOP - do nothing
# REIN* - reinitialize the connection
# STAT - return server status
# STOU - store a file uniquely
# STRU - set file transfer structure
# SYST - return system type
參數說明:LIST 文件或目錄列表
STOR 存儲文件
MKD 建立目錄
CWD 改變目錄
ABOR 終止進程
REST 斷點續傳
--------------------------------------
在線使用的腳本
local_root=/home/dbbackup
cmds_allowed=ABOR,CWD,LIST,MDTM,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,SITE,SIZE,STOR,TYPE,USER,ACCT*,APPE,REIN*,STAT,SYST,REST,CDUP
local_max_rate=80000000
-----------------------------------------
前提配置文件中要開啓:
tcp_wrappers=YES
限制ip訪問,只使用hosts.allow文件便可,不用動hosts.deny文件
vsftpd:222.90.72.87 61.150.91.10:allow
vsftpd:all:denyapp