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

启用vsftpd日志及其解读

2016-03-10 00:00 519 查看
前几天,身为广州北大青鸟湘计立德网络工程师的我被朋友求助帮忙搭个ftp,需求是只能上传,浏览不能下载。初步一想,这权限按常规权限来做的话根本实现不了,因为浏览跟下载是一个权限,没办法区分。朋友对我冷嘲热讽,我动力出来了,打算尝试下,而且估计应该是可以实现的,因为linux有很多意想不到的事情。果然google了下就找到方法了,可以对用户操作ftp的命令进行控制,那就简单了。网上找到了能实现我需求的配置文件,一测试不行,想想还是自己写吧。
  ok,test下果然成功了。
  附上相关说明:
  vsftpd.conf文件:
  connect_from_port_20=YES
  anonymous_enable=NO
  write_enable=YES
  local_umask=002
  listen_port=21
  listen=YES
  pasv_enable=YES
  use_localtime=YES
  connect_timeout=60
  accept_timeout=60
  data_connection_timeout=600
  local_enable=YES
  cmds_allowed=ABOR,CMD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,SIZE,STOR,TYPE,USER
  chroot_list_enable=YES
  chroot_list_file=/etc/vsftpd/vsftpd.chroot.list
  pam_service_name=vsftpd
  xferlog_enable=YES
  xferlog_file=/var/log/vsftpd.log
  注意cmds_allowe这段
  以下是这段相关命令的说明:
  (要注意的是,这行里面不能换行,不能有空格)
  # 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
  根据自己需要选择吧,vsftpd的确很强大,ftp我只用vsftpd。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: