Configure the FTP server to be logged on by a virtual user

Source: Internet
Author: User
Configuring the FTP server to be logged on by a virtual user to configure the FTP server to be logged on by a virtual user can avoid some security issues arising from using the operating system account as the FTP user, it is also easy to manage through databases or other programs. This article uses the FTP server software vsftpd in Linux...
Configuring the FTP server to be logged on by a virtual user to configure the FTP server to be logged on by a virtual user can avoid some security issues arising from using the operating system account as the FTP user, it is also easy to manage through databases or other programs. This article describes how to configure FTP by taking the FTP server software vsftpd in Linux as an example. 1 install necessary software yum install vsftpd yum install db4 # Berkeley DB database, used to store virtual FTP username and password 2 initialize the installation environment mkdir-p/data/vsftpd # This directory stores the directories and files of all virtual users useradd-d/data/vsftpd-s/sbin /nologin vsftpd # Create a vsftpd user, do not log on to chown-R vsftpd: vsftpd/data/vsftpd www.2cto.com mkdir-p/etc/vsftpd/vsftpd_user_conf # store the configuration files of each virtual user in this directory (it can be blank) 3. modify the vsftpd configuration file vi/etc/vsftpd. conf. the content is as follows: [plain] Protocol = NO local_enable = YES write_enable = NO local_umask = 022 protocol = YES nopriv_user = vsftpd chroot_local_user = YES listen = YES pam_service_name = ftp # PAM policy file userlist_enable = YES region = YES guest_enable = YES # Allow virtual users to log on to guest_username = vsftpd local_root =/data/vsftpd/$ USER # USER directory user_sub_token = $ USER region = YES user_config_dir = /etc/vsftpd/vsftpd_user_conf # directory of the user configuration file, vi/etc/pam can be empty. d/ftp, the content is as follows: [plain] auth required/lib64/security/pam_userdb.so db =/etc/vsftpd/your account required/lib64/security/pam_userdb.so db =/etc/vsftpd/www.2cto.com 3 create user I modify the user name and password file vi/etc/vsftpd/logins.txt, add a new user name and password in this file, and the odd number of behavior account names in logins.txt, even behavior password db_load-T-t hash-f/etc/vsftpd/logins.txt/etc/vsftpd/vsftpd_login.db # Database File for generating user names and passwords ii create user directory mkdir/data/ vsftpd/$ new_user_namechown-R vsftpd: vsftpd/data/vsftpd/$ new_user_name 4 start FTP service vsftpd start www.2cto.com chkconfig vsftpd on # set automatic startup 5 delete user I change user name and password file vi/etc/vsftpd/notify Zhongqi number of behavior account names, even behavior password db_load-T-t hash-f/etc/vsftpd/logins.txt/etc/vsftpd/vsftpd_login.dbii delete user directory delete/data/vsftpd user directory common faults: Q: logon failed [plain] 500 OOPS: cannot change directory:/home/vsftpd Login failed. 421 Service not available, remote server has closed connection A: solution www.2cto.com is usually caused by SELinux. the solution is as follows: vi/etc/selinux/config # change selinux = enforcing or permissive to disabled, disable selinux, and setenforce 0 # enable selinux to take effect immediately./etc/init. d/vsftpd restart # restart the FTP service
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.