默认情况下vsftp可配置用户是否可读或者可写,如需实现某些精确的权限控制就要用到cmds_allowed参数。如某用户只能上传下载不能覆盖或删除文件等。
cmds_allowed参数是控制用户可使用的命令列表,配置后用户只可使用列表中的命令,使用列表外的命令会被拒绝。
使用方法如下:
1,修改vsftpd配置文件。
tcp_wrappers=YES
2,编辑要进行权限控制的用户配置文件,加入cmds_allowed=参数,将允许的命令写在=后面。命令之间用,分隔,整条参数没有空格,且全是大写。
3,重新生成配置文件。
db_load -T -t hash -f /etc/vsftpd/vsftpd_login.txt /etc/vsftpd/vsftpd_login.db
全部配置完成。
下面是ftp命令列表:
ABOR – abort a file transfer
CWD – change working directory
DELE – delete a remote file
LIST – list remote files
MDTM – return the modification time of a file
MKD – make a remote directory
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
RETR – retrieve a remote file
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
本文链接地址: https://danteng.org/vsftpd-cmds-allowed-permissions-control/