Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

CentOS 7 installation configuration VSFTP (Virtual User Login)

October 14, 2021By Simo Centos

Characteristics of virtual users:

1. They can only access the FTP service provided by the server, but cannot access other resources of the system. Therefore, if you want users to have write access to the FTP server site, but are not allowed to access other system resources, you can use virtual users to improve the security of the system.

2. Multiple virtual users can be established, their own passwords can be set, and corresponding configurations can be set according to their purposes, which can adapt to many situations.

Principle of virtual users:

Taking local system users as the host (usually local users who cannot log in to the system), and then establishing a mapping relationship between virtual users and local system users to realize virtual users Log in to the FTP service function.

Use yum to install vsftpd
yum -y install vsftpd

Configure the vsftpd service accessed by virtual users

Create virtual users Password file, the odd number is the user name, the even number is the password
vim /etc/vsftpd/vir_user

Centos 7 installation and configuration Vsftp (virtual user login)

Generate virtual user database
[[emailprotected] ~]#yum -y install libdb-utils
[[email protected] ~]#db_load -T -t hash -f /etc/vsftpd/vir_user/etc/vsftpd/vir_user.db
[[email protected] ~]#chmod 700 /etc/vsftpd/vir_user.db

Configure the vsftpd pam verification file:

Comment out all the configuration lines of auth and account, and add the following two lines

[[emailprotected] ~]#vim /etc/pam.d/vsftpd
auth required pam_userdb.so db=/etc/vsftpd/vir_user
account required pam_userdb.so db=/etc/vsftpd/vir_user

Add a system User’virftp’, all virtual users will be mapped to this user to read and write the file system:
mkdir /ftproot
useradd -d /ftproot -s /sbin/nologin virftp
chown -R virftp :virftp /ftproot

Set the main configuration file of vsftpd
[[emailprotected]~]#vim /etc/vsftpd/vsftpd.conf
Centos 7 installation configuration Vsftp( Virtual user login)

Centos 7 installation and configuration Vsftp (virtual user login)

Create and configure the respective configuration files of virtual users, the file name is’virtual user name’

[[emailprotected] ~]#vim /etc/vsftpd/vsftpd_viruser /test1

Centos 7 installation and configuration Vsftp (virtual user login)

Create the root directory of the virtual user, and ensure that the system user mapped by the virtual user has read and write permissions to this root directory

[[emailprotected] ~]#mkdir -p /ftproot/admin/
[[email Protected] ~]#chown -R virftp.virftp /ftproot/admin/

Restart the service
systemctl restart vsftpd
Set the boot auto-start
systemctl enable vsftpd
Turn off the firewall
systemctl stop firewalld
setenforce 0
Use filezilla software to test

Centos 7 installation and configuration of Vsftp (virtual user login)

It’s successful here

centos, configuration, installation, login, user, Virtual, VSFTP

Post navigation

Consistency hash algorithm implementation (pseudo code)
Simple operation of ZooKeeper

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4836 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment Cancel reply

Your email address will not be published.

Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress