您的位置:首页 > 编程语言 > PHP开发

VSFTPD实现用户权限不能删除 只能上传、下载

2017-08-21 13:15 507 查看
点击(此处)折叠或打开

1、只能上传。不能下载、删除、重命名。

cmds_allowed=FEAT,REST,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RMD,SIZE,STOR,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST

方法2:

chown_uploads=YES

chown_username=root

2、只能下载。不能上传、删除、重命名。write_enable=NO

3、只能上传、删除、重命名。不能下载。download_enable=NO

4、只能下载、删除、重命名。不能上传。

cmds_allowed=FEAT,REST,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RMD,RNFR,RNTO,RETR,DELE,SIZE,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST

以上的2、3两点好控制,可是1和4就不是那么好控制了!

这个命令就实现了只能下载上传、不能删除了。具体命令介绍如下:

CWD - change working directory 更改目录

LIST - list remote files 列目录

MKD - make a remote directory 新建文件

NLST - name list of remote directory

PWD - print working directory 显示当前工作目录

RETR - retrieve a remote file 下载文件

STOR - store a file on the remote host 上传文件

DELE - delete a remote file 删除文件

RMD - remove a remote directory 删除目录

RNFR - rename from 重命名

RNTO - rename to 重命名

以上是常用的一些参数,大家对照学习一下!下面是列也的全部参数,供大家参考!

# 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

点击(此处)折叠或打开

[root@vm-nginx01 ~]# cat
/etc/vsftpd/vsftpd.conf

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=002

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

xferlog_std_format=YES

listen_port=3332

listen=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

anon_upload_enable=NO

anon_mkdir_write_enable=NO

anon_other_write_enable=NO

connect_timeout=60

idle_session_timeout=300

use_localtime=YES

banner_file=/opt/nginxlog/banner.ftp

chroot_local_user=YES

chroot_list_file=/etc/vsFTPd.chroot_list

local_root=/web/website/xiazai

#cmds_allowed=FEAT,REST,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RMD,SIZE,STOR,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST

点击(此处)折叠或打开

server

{

listen 80;

server_name xiazai.man.com;

root /web/website/xiazai;

index index.php index.php5 index.htm;

access_log /opt/nginxlog/applog/xiazai.manzuo.com;

#error_log /opt/nginxlog/applog/error.jia;

charset utf-8;

limit_conn perip 10;

limit_rate 200k;

autoindex on;

#location ~ .*\.(gif|jpg|jpeg|png|bmp|wma|mp3|swf)$

location ~ .*\.*$

{

valid_referers none blocked server_names *.manzuo.com;

if ($invalid_referer) {return
403;}

expires 30d;

}

auth_basic "please input username and passwd!";

auth_basic_user_file /opt/app/nginx/conf/domain/xiazai.auth.conf;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: