启用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。
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。
相关文章推荐
- 启用vsftpd日志及其解读
- php 无法加载php.ini问题
- 关于Thinkphp二维数组循环输出问题
- 理解thinkphp的命名空间
- php 关于时区 date gmdate date_default_timezone_set/get 终极答疑
- 关于PHP时间函数使用详情
- php 读取 csv 文件的两种方法
- PHP——上传头像(2)
- PHP——上传头像(1)
- PHP——上传文件
- 树莓派:1. 向树莓派发送文件-FileZilla SFTP
- php-post数据处理
- php的学习笔记之面向对象(四)继承补充
- php跳转
- php之跳转
- php curl (get post)
- php的学习笔记之面向对象(四)继承
- 会员中心增加会员登录次数显示功能–PHPCMS V9
- phpcmsV9后台审核内容增加删除修改内容选项!
- PHP时间函数详解