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

Analysis and application of irregular picture waterfall flow principle

The layout problem of irregular picture walls enc...

How to install FastDFS in Docker

Pull the image docker pull season/fastdfs:1.2 Sta...

Comprehensive understanding of HTML basic structure

Introduction to HTML HyperText Markup Language: H...

Three methods of inheritance in JavaScript

inherit 1. What is inheritance Inheritance: First...

Analysis of the configuration process of installing mariadb based on docker

1. Installation Search the mariadb version to be ...

iview implements dynamic form and custom verification time period overlap

Dynamically adding form items iview's dynamic...

Vendor Prefix: Why do we need a browser engine prefix?

What is the Vendor Prefix? Vendor prefix—Browser ...

Windows Server 2016 Quick Start Guide to Deploy Remote Desktop Services

Now 2016 server supports multi-site https service...

Detailed explanation of MySQL redo log (redo log) and rollback log (undo logo)

Preface: The previous article described several c...

js implements a simple countdown

This article example shares the specific code of ...

3 simple ways to achieve carousel effects with JS

This article shares 3 methods to achieve the spec...

How to customize Docker images using Dockerfile

Customizing images using Dockerfile Image customi...

Gogs+Jenkins+Docker automated deployment of .NetCore steps

Table of contents Environmental Description Docke...

Detailed analysis of the difference between Ref and Reactive in Vue3.0

Table of contents Ref and Reactive Ref Reactive T...