centos7安装vsftp配置虚拟用户,详细介绍,亲测完美!
2018-01-26 18:39
841 查看
安装前的准备
关闭防火墙或者开端口权限。一般是firewalld或者iptables。systemctl stop firewalld systemctl disable firewalld
关闭sellinux
立即关闭
setenforce 0
重启也关闭
vi /etc/selinux/config
修改
SELINUX=disabled
查看是否关闭
getenforce
安装vsftpd
很简单一句话yum install -y vsftpd
立即启动
systemctl start vsftpd
跟随系统启动而启动
systemctl enable vsftpd
配置vsftpd
创建vsftpd使用的系统用户,主目录为/home/vsftpd,禁止ssh登录。创建之后所有虚拟用户使用这个系统用户访问文件。useradd vsftpd -d /home/vsftpd -s /bin/false
创建虚拟用户主目录,比如虚拟用户叫ftp1,执行下面的命令。
mkdir -p /home/vsftpd/ftp1
创建这个虚拟用户
vi /etc/vsftpd/loginusers.conf
增加
ftp1 123456
这样就创建了ftp1这个虚拟用户,密码为123456
根据这个文件创建数据库文件
db_load -T -t hash -f /etc/vsftpd/loginusers.conf /etc/vsftpd/loginusers.db chmod 600 /etc/vsftpd/loginusers.db
启用这个数据库文件
vi /etc/pam.d/vsftpd
注释掉所有内容后,增加下面的内容
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/loginusers account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/loginusers
创建虚拟用户配
4000
置文件
mkdir /etc/vsftpd/userconf
这里的文件名称必须与虚拟用户名一致
vi /etc/vsftpd/userconf/ftp1
增加下面的内容
local_root=/home/vsftpd/ftp1/ write_enable=YES
设定主目录为/home/vsftpd/ftp1
最后修改主配置文件
vi /etc/vsftpd/vsftpd.conf
更改
anonymous_enable=NO
去掉注释
chroot_local_user=YES ascii_upload_enable=YES ascii_download_enable=YES
增加
guest_enable=YES guest_username=vsftpd user_config_dir=/etc/vsftpd/userconf allow_writeable_chroot=YES
配置介绍:
anonymous_enable=NO 禁止匿名用户登录
chroot_local_user=YES 禁止用户访问除主目录以外的目录
ascii_upload_enable=YES ascii_download_enable=YES 设定支持ASCII模式的上传和下载功能
guest_enable=YES 启动虚拟用户
guest_username=vsftpd 虚拟用户使用的系统用户名
user_config_dir=/etc/vsftpd/userconf 虚拟用户使用的配置文件目录
allow_writeable_chroot=YES 最新版的vsftpd为了安全必须用户主目录(也就是/home/vsftpd/ftp1)没有写权限,才能登录,或者使用allow_writeable_chroot=YES
最后重启服务使配置生效
systemctl restart vsftpd
相关文章推荐
- linux的Nginx安装、默认虚拟主机、用户认证、域名重定向配置介绍
- nginx介绍,nginx安装,配置nginx默认虚拟主机,nginx用户认证,域名重定向
- centos 安装 vsftp 及虚拟用户配置
- vsftp安装及配置虚拟用户配置
- CentOS安装配置vsftp虚拟用户登录
- Vsftp安装及配置虚拟用户
- CentOS7安装vsftpd3.0.2、以及虚拟用户配置
- centos7编译安装apache后添加用户认证和配置虚拟主机
- vsftp虚拟用户安装配置
- linux——安装vsftp及配置虚拟匿名用户脚本
- CentOS6 vsFTP安装与配置(使用虚拟用户)
- centos5.8 安装配置vsftp虚拟用户
- CentOS 下vsftp 安装--虚拟用户
- centos7:vsftp搭建及详细配置
- Django 介绍、安装配置、基本使用、Django 用户注冊样例
- VSFTP+MySQL虚拟用户配置
- VSFTP配置虚拟用户
- 详解CentOS7安装配置vsftp搭建FTP
- vsftpd安装配置虚拟用户
- VSFTP+MySQL虚拟用户配置过程