centos 配置vsftpd 虚拟用户
2013-04-16 13:18
489 查看
vsftp虚拟用户进不同目录
yum install vsftpd -y1. 创建虚拟用户数据库,首先创建一个文本文件
# vi /etc/vsftpd/user.txt
hnzymg
meldoy
hnzyzmd
melodyzabbix
2.生成数据库
db_load -T -t hash -f /etc/vsftpd/user.txt /etc/vsftpd/vsftpd_user.db
会提示-bash: db_load: command not found
#rpm -qa |grep vsftpd
vsftpd-2.0.5-28.el5
# rpm -qa |grep db4
db4-4.3.29-9.fc6 {}FC6(i386)中默认可能只安装了db4-4.3.29-9.fc6.i386.rpm和db4-devel-4.3.29-9.fc6.i386.rpm要使用db_load需要将位其他几张光盘中的db4-java-4.3.29-9.fc6.i386.rpm\db4-tcl-4.3.29-9.fc6.i386.rpm\db4-utils-4.3.29-9.fc6.i386.rpm安装上
# yum install db* -y
# db_load -T -t hash -f /etc/vsftpd/user.txt /etc/vsftpd/vsftpd_user.db (可以了)
3.修改数据库权限
# chmod 600 /etc/vsftpd/vsftpd_user.db
4.修改pam 认证
vi /etc/pam,d/vsftpd
注释掉现有的所有配置,添加如下:
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_user
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_user {最后写相对路径,容易503错误}
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_user
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_user
5.新建虚拟用户groupadd testuseradd -d /app/app -M -g test hnzymguseradd -d /app/list -M -g test hnzyzmd6.修改vsftpd.conf 配置文件anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
user_config_dir=/etc/vsftpd/vsftpd_user_conf
pam_service_name=vsftpd7.建立 vsftpd_user_conf 目录
mkdir vsftpd_user_conf
vim hnzymg
guest_enable=yes
guest_username=hnzymg
local_root=/home/web
vim hnzyzmd
guest_enable=yes
guest_username=hnzyzmd
local_root=/home/web/zmd
保存退出。
重启服务
chkconfig vsftpd on
8.测试。。。可能会出现只能上传文件,不能修改服务器上的文件等操作。
解决方法:①:首先看下文件权限(我的可是777)不存在此情况
②:non_world_readable_only=NO 可读可下载 kill
anon_upload_enable=YES 可上传
download_enable = NO 不能下载
anon_mkdir_write_enable=YES 可创建和删除文件夹
anon_other_write_enable=YES 可文件改名和删除文件 local_root=/home/ftpsite/mike 指定mike的宿主目录 (注意:请先到/home/ftpsite下面去创建mike文件夹
最后,前几天在网上看到一个更全面的权限配置,这里摘抄过来。以便以后需求!
cmds_allowed=ABOR,CMD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,SIZE,STOR,TYPE,USER
注意cmds_allowe这段(.conf) 以下是这段相关命令的说明: (要注意的是,这行里面不能换行,不能有空格) # 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。
相关文章推荐
- CentOS6.6下vsftpd虚拟用户配置
- centos下配置vsftpd虚拟用户终极教程
- CentOS 6.4 下安装vsftpd并配置虚拟用户
- CentOS 6.6 下安装vsftpd并配置虚拟用户
- CentOS 6.2配置vsftpd虚拟用户
- centos6.5下vsftpd服务的安装及配置并通过pam认证实现虚拟用户文件共享
- centos7 安装vsftpd和配置以及虚拟用户权限分配
- CentOS 6.5系统安装vsFTPd并配置虚拟用户
- centos6.5下vsftpd服务的安装及配置并通过pam认证实现虚拟用户文件共享
- CentOS6.6 Vsftpd虚拟用户配置
- CentOS 6.2 快速配置vsftpd虚拟用户
- CentOS 6.2 快速配置vsftpd虚拟用户的步骤分享
- CentOS6/5下vsftpd(虚拟用户)的配置
- centos6.0 vsftpd虚拟用户配置总结
- CentOS 6.4下安装vsftpd、配置虚拟用户登录
- centos7 安装vsftpd和配置虚拟用户访问及权限分配
- Centos 6.2 快速配置vsftpd虚拟用户
- centos6.3--64位vsftpd虚拟用户配置
- Centos 6.2 快速配置vsftpd虚拟用户 推荐
- 华为云-Centos7.4主机Vsftpd 3.0.2版本虚拟用户配置