How to configure virtual user login in vsftpd

How to configure virtual user login in vsftpd

yum install vsftpd

[root@localhost etc]# yum -y install vsftpd

Create a virtual user and password

[root@localhost etc]# cd /etc/vsftpd
[root@localhost vsftpd]# vim vuser.list

Single line username and double line password

insert image description here

Create database files

[root@localhost vsftpd]# db_load -T -t hash -f vuser.list vuser.db

Improving the security of virtual users

[root@localhost vsftpd]# chmod 600 /etc/vsftpd/vuser.*
[root@localhost vsftpd]# ls -lh /etc/vsftpd/vuser.*
-rw------. 1 root root 12K Dec 25 17:55 /etc/vsftpd/vuser.db
-rw------. 1 root root 21 Dec 25 17:51 /etc/vsftpd/vuser.list

Create a mapping account

[root@localhost vsftpd]# useradd -s /sbin/nologin -d /var/ftproot along
[root@localhost vsftpd]# chmod -R 777 /var/ftproot/

Create a PAM authentication file

[root@localhost vsftpd]# cd /etc/pam.d/
[root@localhost pam.d]# ls
chfn fingerprint-auth-ac password-auth-ac remote smtp sudo -i vlock
chsh login polkit-1 runuser smtp.postfix su -l vmtoolsd
config-util other postlogin runuser-l sshd system-auth vsftpd
crond passwd postlogin-ac smartcard-auth su system-auth-ac vsftpd.rpmsave
fingerprint-auth password-auth ppp smartcard-auth-ac sudo systemd-user vsftpd.user
[root@localhost pam.d]# vim vsftpd 

insert image description here

Modify the main configuration file

[root@localhost pam.d]# cd /etc/vsftpd/
[root@localhost vsftpd]# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh vuser.db vuser.l
[root@localhost vsftpd]# cp vsftpd.conf vsftpd.conf.bak
[root@localhost vsftpd]# vim vsftpd.conf
[root@localhost vsftpd]# cat vsftpd.conf | grep -v "^$" | grep -v "^#"
anonymous_enable=NO
allow_writeable_chroot=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_umask=022
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
user_config_dir=/etc/vsftpd/users
guest_enable=YES
guest_username=along
userlist_enable=YES
tcp_wrappers=YES

Create a users directory file and create a configuration file for each virtual user

[root@localhost vsftpd]# mkdir users
[root@localhost users]# vim cuibo

anon_upload_enable=YES
anon_mkdir_write_enable=YES
write_enable=YES
anon_world_readable_only=NO
anon_other_write_enable=YES
anon_umask=022
local_root=/var/ftproot/admin

[root@localhost users]# vim long

write_enable=YES
anon_world_readable_only=NO
anon_other_write_enable=YES
anon_umask=022
local_root=/var/ftproot/admin

Increase permissions and comment out the user under ftpusers

[root@localhost users]# mkdir /var/ftproot/admin
[root@localhost users]# chown -R along.along /var/ftproot/admin/
[root@localhost users]# cd ..
[root@localhost vsftpd]# vim ftpusers

#root
#bin
#daemon
#adm
#lp
#sync
#shutdown
#halt
#mail
#news
#uucp
#operator
#games
#nobody

Turn off the firewall and lower the sandbox level and restart the service

[root@localhost vsftpd]# systemctl stop firewalld
[root@localhost vsftpd]# setenforce 0
[root@localhost vsftpd]# systemctl restart vsftpd

Client Authentication and FileZille Authentication

[root@localhost vsftpd]# ftp 192.168.1.200
Connected to 192.168.1.200 (192.168.1.200).
220 (vsFTPd 3.0.2)
Name (192.168.1.200:root): cuibo
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

insert image description here

Summarize

The above is the method of configuring virtual user login in vsftpd introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • A brief analysis of vsftpd service configuration in Linux (anonymous, user, virtual user)
  • How to install vsftpd and PAM virtual users on centos 6
  • Build a vsftpd server application based on virtual users
  • Establishing VSftpd service based on virtual users
  • VSFTPD configuration (anonymous - local user - virtual user)
  • vsftpd virtual user configuration steps

<<:  A brief understanding of the three principles of adding MySQL indexes

>>:  The pitfall record of the rubber rebound effect of iOS WeChat H5 page

Recommend

Implement a simple search engine based on MySQL

Table of contents Implementing a search engine ba...

How to prohibit vsftpd users from logging in through ssh

Preface vsftp is an easy-to-use and secure ftp se...

MYSQL unlock and lock table introduction

MySQL Lock Overview Compared with other databases...

Vue implements verification code countdown button

This article example shares the specific code of ...

JavaScript selector functions querySelector and querySelectorAll

Table of contents 1. querySelector queries a sing...

MYSQL slow query and log settings and testing

1. Introduction By enabling the slow query log, M...

Summary of several MySQL installation methods and configuration issues

1. MySQL rpm package installation # Download the ...

How to shrink the log file in MYSQL SERVER

The transaction log records the operations on the...

MySQL import and export backup details

Table of contents 1. Detailed explanation of MySQ...

Node+socket realizes simple chat room function

This article shares the specific code of node+soc...

Html sample code for reading and displaying pictures in a local folder

One purpose Select a local folder on the Html pag...

JavaScript super detailed implementation of web page carousel

Table of contents Creating HTML Pages Implement t...