FTP 服务器

Server:192.168.1.211

虚拟用户

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
yum -y install vsftpd pam libdb libdb_utils
vim /etc/vsftpd/user.txt
ftp1
pass1
ftp2
pass2
db_load -T -t hash -f /etc/vsftpd/user.txt /etc/vsftpd/login.db
chmod 700 /etc/vsftpd/login.db
vim /etc/pam.d/virt_ftp
auth required pam_userdb.so db=/etc/vsftpd/login
account required pam_userdb.so db=/etc/vsftpd/login
vim /etc/vsftpd/vsftpd.conf
pam_service_name=virt_ftp
guest_enable=YES
guest_username=ftpuser
user_config_dir=/etc/vsftpd/vsftpd_user_conf
allow_writeable_chroot=YES
#virtual_user_local_privs=YES
mkdir -p /etc/vsftpd/vsftpd_user_conf
vim ftp1
local_root=/home/ftpuser/ftp1
write_enable=YES
anon_world_readable_only=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
vim ftp2
local_root=/home/ftpuser/ftp2
write_enable=YES
anon_world_readable_only=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
useradd ftpuser
mkdir /home/ftpuser/ftp{1,2}
chown -R ftpuser:ftpuser /home/ftpuser