安装FTP服务端
[[email protected] ~]# rpm -ivh /media/Packages/vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
详细配置
[[email protected] ~]# grep ^[^#] /etc/vsftpd/vsftpd.conf
anonymous_enable=NO #不允许匿名访问
local_enable=YES #允许本地用户访问
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES #锁定根目录
listen=YES
user_config_dir=/etc/vsftpd/vsftpd_user_conf #用户配置目录
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
[[email protected] ~]# mkdir /etc/vsftpd/vsftpd_user_conf
创建本地用户
[[email protected] ~]# useradd -s /sbin/nologin cce
[[email protected] ~]# echo 123456 | passwd --stdin cce
[[email protected] ~]# useradd -s /sbin/nologin cfj
[[email protected] ~]# echo 123456 | passwd --stdin sfj
对文件设置acl权限
[[email protected] ~]# setfacl -R -m user:cce:rwx /var/www/html/
[[email protected] ~]# setfacl -R -m default:cce:rwx /var/www/html/
[[email protected] ~]# setfacl -R -m user:cfj:rwx /var/www/ceshi/
[[email protected] ~]# setfacl -R -m default:cfj:rwx /var/www/ceshi/
创建用户配置目录并对单个用户的根目录进行配置
[[email protected] ~]# cat /etc/vsftpd/vsftpd_user_conf/cce
local_root=/var/www/html
[[email protected] ~]# cat /etc/vsftpd/vsftpd_user_conf/cfj
local_root=/var/www/ceshi
[[email protected] ~]# /etc/init.d/vsftpd restart
测试登录
测试上传