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

vsftpd用户配置 No.2

2016-05-19 23:10 561 查看
在配置ftp虚拟用户的过程中,还有一种配置方式。

yum -y install 安装vsftpdcp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak

编辑vsftpd.conf开启下列选项:anonymous_enable=NOlocal_enable=YESwrite_enable=YESlocal_umask=022anon_mkdir_write_enable=NOdirmessage_enable=YESxferlog_enable=YESconnect_from_port_20=YESchown_uploads=NOxferlog_file=/var/log/vsftpd.logxferlog_std_format=YESascii_upload_enable=YESascii_download_enable=YESftpd_banner=Welcome to blah FTP service.chroot_list_enable=YESchroot_list_file=/etc/vsftpd/chroot_listlisten=YESpam_service_name=vsftpduserlist_enable=YEStcp_wrappers=YESuse_localtime=YESpasv_enable=YESuser_config_dir=/etc/vsftpd/vsftpd_user_conf具体配置的注释可以参考上篇文章的注释。

因为我们上边配置文件设置了用户锁定跟目录:因此我们在配置文件目录下创建的chroot_list 就是我们的ftp用户。touch chroot_list在/etc/vsftpd/下创建用户目录创建ftp用户 useradd -m -d /home/test test -s /sbin/nologin 并设置密码!mkdir vsftpd_user_conf cd vsftpd_user_conf touch 用户文件cmds_allowed=FEAT,REST,CWD,LIST,MDTM,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,SIZE,STOR,TYPE,USER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST,MKD最后我们在用户文件中配置ftp用户权限,重启vsftpd服务即可!

这里插入一个权限的说明文档,是我在网上找的!

vsftpd cmds_allowed 权限控制

cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR…………注意:一定不能使用换行和空格,不然就没效果..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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vsftpd