zoukankan      html  css  js  c++  java
  • vsftp实现只能上传不能下载、删除权限配置

    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:deny

  • 相关阅读:
    Java 解惑:Random 种子的作用、含参与不含参构造函数区别
    Linux系统网络性能实例分析
    数据库服务器的性能调优-续
    Spring代理模式及AOP基本术语
    Spring框架总结
    单例模式和多例模式
    jqueryUI小案例
    Ajax讲解
    数据校验和国际化
    文件上传(多文件上传)/下载
  • 原文地址:https://www.cnblogs.com/yjken/p/3917902.html
Copyright © 2011-2022 走看看