vsfrtpt virtual user configuration

1. Install the required software and authentication modules vsftpd
yum install pam * libdb-utils libdb * --skip -broken -y

2. Create a virtual user temporary file /etc/vsftpd/ftpusers.txt
laoyang.1
123
laoyang2
123

3. Generate vsftpd authentication database file permissions to 700
db_load hash -T -t -f /etc/vsftpd/ftpusers.txt /etc/vsftpd/vsftpd_login.db
chmod 700 /etc/vsftpd/vsftpd_login.db

4. pam generate certification documents, in the first row /etc/pam.d/vsftpd add the following code
the auth required pam_userdb.so DB = / etc / the vsftpd / vsftpd_login
Account required pam_userdb.so DB = / etc / the vsftpd / vsftpd_login

5.vsftpd virtual user is mapped to ftpuser system users
useradd -s / sbin / nologin ftpuser

6.vsftpd.conf 配置文件
#global config Vsftpd 2020
anonymous_enable=YES
local_enable=YES
writer_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES
userlist_enable=YES
tcp_wrapper=YES
#config virtual user FTP
pam_service_name=vsftpd
guest_enable=YES
guest_username=ftpuser
user_config_dir=/etc/vsftpd/vsftpd_user_conf
virtual_user_local_privs=YES

7. Virtual User Profiles home directory
mkdir -p / etc / vsftpd / vsftpd_user_conf /

8. laoyang1 user profile and proprietary virtual directory
local_root = / Home / ftpuser / laoyang1
writer_enable = YES
anon_world_readable_only = YES
anon_upload_enable = YES
anon_mkdir_writer_enable = YES
anon_other_writer_enable = YES

Laoyang2 profile for the user and proprietary virtual directory
local_root = / Home / ftpuser / laoyang2
writer_enable = YES
anon_world_readable_only = YES
anon_upload_enable = YES
anon_mkdir_writer_enable = YES
anon_other_writer_enable = YES

9. Create a virtual user virtual directory
mkdir -p / home // ftpuser / { laoyang1, laoyang2}; chown -R ftpuser: ftpuser / home / ftpuser

Released eight original articles · won praise 2 · Views 240

Guess you like

Origin blog.csdn.net/qq_45645003/article/details/104340171