Create FTP virtual user configuration process in linux-non-System Account Login FTP

Source: Internet
Author: User
This is often the case in enterprises. You need to create FTP accounts for them to manage ftp services, rather than having them system accounts. Although they can be set to make them unable to log on to the system, if there are a bunch of Ftp accounts that need advice, creating a multi-system account also feels uncomfortable and not very secure. The following method is to Configure FTP virtual users.

This often happens in enterprises. You need to create FTP accounts for them to manage them.FtpServices, but do not want them to have system accounts. Although they can be set to make them unable to log on to the system, if there are a bunch of Ftp accounts that need advice, creating a multi-system account also feels uncomfortable and not very secure.

The following method is used to configure FTP virtual users. They can only log on to ftp, not the system account.

Yum-y install vsftpd

1. Create a Vsftpd virtual user:

1. Add a virtual user password file to install Vsftpd

[Root @ localhost ~] # Vi/etc/vsftpd/vftpuser.txt

Add the virtual user name and password, one line of user name, one line of password, and so on. An odd behavior username and an even behavior password.

Ftp1 # User Name

123456 # Password

Ftp2 # User Name

123456 # Password

2. Generate a virtual user password authentication File

Convert the vftpuser.txt virtual user password file to a password authentication file recognized by the system.

First, check whether the system has installed the software db4-uti required to generate the password authentication FileLs.

Db_loadCommandGenerate a virtual user password authentication file.

[Root @ localhost ~] # [Root @ localhost ~] # Db_load-T-t hash-f/etc/vsftpd/vftpuser.txt

/Etc/vsftpd/vftpuser. db

3. Edit the PAM Authentication File For vsftpd

In the/etc/pam. d directory,

[Root @ localhost ~] # Vi/etc/pam. d/vsftpd

Comment out all the other ones and add the following two lines:

Auth requirEd/Lib/security/pam_userdb.so db =/etc/vsftpd/vftpuser

Account required/lib/security/pam_userdb.so db =/etc/vsftpd/vftpuser

4. Create a local ing user and set the Home Directory Permissions

All FTP virtual users need one system user, which does not need a password.

[Root @ localhost ~] # UseraDd-D/home/vftpsite-s/sbin/nologin vftpuser

[Root @ localhost ~] #Chmod755/home/vftpsite // set the value to 700 on the Internet. After the value is set to 700, the FTP user has no upload permission.

5. Configure vsftpd. conf (set virtual user configuration items)

[Root @ localhost ~] # Vi/etc/vsftpd. conf

Guest _Enable= YES # enable a virtual user

Guest_username = vftpuser

Pam_service_name = vsftpd # PAM Authentication File

6. Restart the vsftpd service.

[Root @ localhost ~] # Service vsftpd restart

7. Test Virtual user login to FTP

 

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.