RedHat 5.5 vsftd server construction configuration Record Based on Virtual User Authentication

Source: Internet
Author: User

1. Create a virtual user password Library File
 
# Vi/etc/vsftpd/login.txt
Add the username and password (the odd line is the username, and the even line is the password ):
Ftp_test
123456
Wq save and exit
Ii. Generate vsftpd Authentication Files
 
# Db_load-T-t hash-f/etc/vsftpd/login.txt/etc/vsftpd/login. db
If you are prompted that the db_load command is not available, install the db4-utils first:
 
# Yum install db4-utils
3. Set the authentication file to be readable and writable only to the root user
 
# Chmod 600/etc/vsftpd/login. db
4. Create the PAM Configuration File required by the virtual user and manually create the vsftpd. vu File
 
# Vi/etc/pam. d/vsftpd. vu
Input:
 
Uth required pam_userdb.so db =/etc/vsftpd/login
Account required pam_userdb.so db =/etc/vsftpd/login
Note: Do not add a path before pam_userdb.so.
5. Create a system user account used by all FTP virtual user accounts and Set permissions for the home directory of the account
 
# Useradd-d/home/vsftp-s/sbin/nologin vftp
6. Configure the vsftpd. conf file
 
# Vi/etc/vsftpd. conf
Modify and add content:
 
Anonymous_enable = NO # disable anonymous user logon
Anon_umask = 002
Anon_world_readable_only = NO # downloadable
Anon_upload_enable = YES # upload allowed
Anon_mkdir_write_enable = YES # You can create a directory.
Anon_other_write_enable = YES # It can be modified or deleted.
Guest_enable = YES # open a virtual user
Guest_username = vftp # system user corresponding to the FTP virtual user <pre class = "plain" name = "code"> pam_service_name = vsftpd. vu # PAM Authentication File
Local_root =/var/www/html # directory automatically switched after login (if this line is not added, the virtual user logs on to the/home/vsftp directory)
Wq is saved and exited.
7. Restart the vsftpd service
 
# Service vsftpd restart
8. Solve the problem that apache files cannot be accessed (displaying files without permission)
Add an ftp user (vftp here) to the apache user group, and set the user group to have the write permission:
 
# Usermod-a-G apache vftp # Add vftp to User Group apache
# Chown-R: apache/var/www/html # Set/var/www/html to apache
# Chmod-R g + rw/var/www/html # Set the/var/www/html permission to allow the user group to read and write
Note: you also need to confirm anon_umask = 002 in vsftpd. conf so that the user group of the newly uploaded file has the write permission.

References:
Http://www.bkjia.com/ OS /201112/115707.html

Http://www.bkjia.com/ OS /201112/115708.html

Http://www.bkjia.com/ OS /201112/115709.html


From http://blog.csdn.net/skyman_2001

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.