Use vsftp to set up the ftp server-Linux Enterprise Application-Linux server application information. The following is a detailed description. Link: http://www.syitren.com/bbs/thread-1376-1-1.html
Reprinted please note!
VSFTPD is a secure and fast FTP server in UNIX/Linux and has been used by many large websites. VSFTPD support
Store the user name and password in a database file or database server. VSFTPD calls this form of user as a virtual user. Relative
For FTP local (system) users, virtual users are only private users of the FTP server, and virtual users can only access
Resources, which greatly enhances the security of the system itself. Compared with anonymous users, virtual users need the user name and password to obtain FTP
The files in the server increase the manageability of users and downloads. If you need to provide the download service, but do not want everyone to renew
Name download. Virtual users are an excellent choice for managing download users, taking into account host security and convenient management of FTP sites.
Good solution. This article describes how to save the VSFTPD virtual user name and password in the MySQL database server on centos.
1) install vsftp
# Tar-zxvf vsftpd-2.0.6.tar.gz
# Cd vsftpd-2.0.6
For installation steps, refer to the INSTALL file in the directory.
# Mkdir/usr/share/empty/
# Mkdir/var/ftp/
# Useradd-d/var/ftp
# Chown root. root/var/ftp
# Chmod og-w/var/ftp
# Make; make install
# Cp vsftpd/usr/local/sbin/vsftpd
# Mkdir/usr/local/man
# Cp vsftpd. conf.5/usr/local/man/man5
# Cp vsftpd.8/usr/local/man/man8
# Cp RedHat/vsftpd. pam/etc/pam. d/ftp
# Cp vsftpd. conf/etc
# Vi/etc/vsftpd. conf
Add a row at the end
Listen = YES
Start vsftp Service
#/Usr/local/sbin/vsftpd &
Use anonymous or an ftp user to test the password. The password is empty.
Allow local users to log on:
# Vi/etc/vsftpd. conf
Local_enable = YES
Pam_service_name = ftp
Create a new user and restart the service to log on and test it.
# Killall-HUP vsftpd // restart the vsftpd service
Main directory of banned users:
# Touch/etc/vsftpd. chroot_list
A. restrict all users from switching Directories
Chroot_local_user = YES
B. The specified user cannot switch directories.
Chroot_local_user = NO
Chroot_list_enable = YES
Chroot_list_file =/etc/vsftpd. chroot_list
Input the user who needs to ban the home directory to the/etc/vsftpd. chroot_list file.
Store usernames and passwords in the database
A) create a virtual user password library file, set the username for odd lines in the password library file, and set the password for even lines.
# Crypt = 1: Use the crpyt () function (corresponding to encrypt () in SQL data, encrypt () to randomly generate salt)
# Crypt = 2: Use the password () function in MYSQL for encryption.
# Crypt = 3: indicates the md5 hash mode # the preceding two statements are configured. The first sentence is based on auth, and the second sentence is based on account.
.
E) virtual user configuration
The configuration of vsftpd. conf is the same as the user name and password of the database.
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