Virtual user support for Pureftpd Configuration

Source: Internet
Author: User

PureftpdIs an Ftp program. Let's take a look at one of his configurations: virtual user support

Since version 0.99.2, pure-ftpd has started to support virtual users. To enable pure-ftpd to support virtual users, you need to add the option -- with-puredb during compilation, or use -- with-everything, just like in our test, of course, this is determined by the use of various users. The virtual user method is very similar to/etc/passwd. It stores user information, such as passwords, names, UIDs, and directories, into files. However, this file only applies to FTP. This means that you can set virtual users for FTP without adding system users to the system. In addition, you can separately set quotas, ratio, bandwidth, and other limits for these users. Many virtual users can share the attributes of the same system user. Therefore, we recommend that you create a single system user for these virtual users to facilitate management. We chose to create a new system user (after testing, if you use the Ftp user that comes with the linux system, the user will not be trusted when you log on with a virtual user. You can also do experiments, see if this is the case ). The method is as follows:

 
 
  1. # groupadd ftpgroup  
  2.  
  3. # useradd -g ftpgroup -d /dev/null -s /sbin/nologin ftpuser  

After the system account is created, we start to prepare virtual users.

Virtual User Creation Method

You can use "pure-pw" to create a virtual user. The virtual user information is stored in the corresponding file in one row for each user. In addition to the account, password, uid, gid, and home directories, other information can be null.

The syntax of pure-pw useradd is as follows:

 
 
  1. pure-pw useradd [-f ] -u [-g ]  
  2.  
  3. -D/-d [-c ]  
  4.  
  5. [-t ] [-T ]  
  6.  
  7. [-n ] [-N ]  
  8.  
  9. [-q ] [-Q ]  
  10.  
  11. [-r [/][,[/]]...]  
  12.  
  13. [-R [/][,[/]]...]  
  14.  
  15. [-i [/][,[/]]...]  
  16.  
  17. [-I [/][,[/]]...]  
  18.  
  19. [-y ]  
  20.  
  21. [-z -] [-m]  

Suppose we want to create a virtual user such as test, we can use the following command:

# Pure-pw useradd test-u ftp-d/var/ftp/test

Here,-u associates the virtual user test with the System user ftp. The-d parameter allows test to only access its home directory. If you want him to access the entire file system, you can use the-D option.

After executing the preceding command, you will be prompted to enter the password. We can enter 123456.

Then you need to change the/var/ftp/test directory and its attributes.

Note: The configuration file has the option to automatically create the main directory.

CreateHomeDir yes // we can set it to yes, but one thing you need to note is that it only supports the creation of L2 directories and does not support the creation of L3 directories. For example, use the following statement to create a virtual user:

# Pure-pw useradd test-u ftp-d/home/ftp command. In this case, the system only has the/home directory but does not have the/home/ftp directory, the/home/ftp directory will be created when the test user logs in for the first time. If we change the preceding command, the following command is used:

# Pure-pw useradd test-u ftp-d/home/ftp/test. In this case, the system only has the/home directory or/home/ftp directory, without the/home/ftp/test directory, we will receive a message indicating that there is no home directory when logging on.

Meanings of other parameters:

The-z option uses the time period specified by the user during the day to connect to the server. For example,-z 0900-1800, the user can only connect to the server from nine o'clock A.M..

-R option or-R option, which can restrict users from connecting to the server from the specified IP address and mask

-Y: The number of concurrent connections at the same time. ''Or 0 means no limit

-F: by default, the virtual user information will be stored in the./etc/pureftpd. passwd file. This option can be used to change the location of the file.

The user's password will select the most secure mode for encryption based on the system's support for the encryption method.

Through the above introduction, we have learned how to support virtual users of Pureftpd! Hope it will be useful to you!

  • Anonymous user login for Pureftpd Configuration
  • Pureftpd installation documentation
  • PureFTPd configuration file
  • PureFTPd displayrate () Remote Denial of Service Attack Vulnerability
  • PureFTPd Accept_Client Remote Denial of Service Vulnerability

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.