1
2
3
4
5
|
yum
install
-y vsftpd
vi
/etc/vsftpd/vsftpd
.conf
#开启用户登录认证
anonymous_enable=NO
local_root=
/data
chroot_local_user=YES
|
1
2
3
4
5
|
vi
/etc/vsftp/user_list
.txt
user1
pass
user2
pass
|
1
2
|
db_load -T -t
hash
-f
/etc/vsftpd/user_list
.txt
/etc/vsftpd/user_list
.db
chmod
600
/etc/vsftpd/user_list
.db
|
1
2
3
|
vi
/etc/pam
.d
/vsftpd
.vu
auth required
/lib64/security/pam_userdb
.so db=
/etc/vsftpd/user_list
account required
/lib64/security/pam_userdb
.so db=
/etc/vsftpd/user_list
|
1
2
|
useradd
-s
/sbin/nologin
vftp
chmod
700
/home/vftp
|
1
2
3
4
|
vi
/etc/vsftpd/vsftpd
.conf
guest_enable=YES
guest_username=vftp
pam_service_name=vftpd.vu
|
1
2
3
|
vi
/etc/vsftpd/vsftpd
.conf
user_config_dir=
/etc/vsftpd/vsftpd_user_conf
mkdir
/etc/vsftpd/vsftpd_user_conf
|
1
2
3
4
5
6
7
|
vi
/etc/vsftpd/vsftpd_user_conf/user1
local_root=
/ftp/share
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_world_readable_only=NO
#开放用户浏览、下载权限
anon_other_write_enable=YES
#重命名权限、续传,不建议开
|
1
2
|
chown
vftp:root -R
/ftp/share
service vsftpd restart
|