Use a shell user or virtual user to log on to pureftpd

Source: Internet
Author: User
Article Title: Use a shell user or virtual user to log on to pureftpd. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Abstract: This article explains how to log on to pureftpd using shell users in Unix systems and how to log on with virtual users.

Directory:

1. Real (shell) User Logon

Ii. puredb virtual user support

Iii. Skills

------------------------------------------------------------------ Cut-off line -----------------------------------------------------------------

  1. Real (shell) User Logon

The default configuration file allows anonymous users to log on and allows real users to log on to the system. After completing the above steps (for details, see my previous article "pureftpd basics: installation, configuration, and Anonymous Logon"), we can log on to the system as a user, you can also upload, download, create directories, and delete files.

If you want to allow FTP to only support real user logon, you only need to modify the configuration file of pureftpd.

# Ee/usr/local/etc/pure-ftpd.conf

ChrootEveryone yes

NoAnonymous yes

UnixAuthentication yes // use user authentication in "/etc/passwd"


Only the above three lines can be used to allow real users to log on to FTP. Real users of the system log on to their home directories, which can be downloaded, uploaded, and deleted without any restrictions. However, due to chroot restrictions, it is impossible to go to other directories in the real system. In practical applications, this usage is rare, so I will not bother to introduce it.

 Ii. puredb virtual user support

1. Create FTP-specific system users.

Since version 0.99.2, pure-ftpd has started to support virtual users.

A virtual user is a simple User List mechanism, similar to "/etc/passwd". It lists user information, such as passwords, names, uid, gid, and home directories, store a text file. However, this text file is only applicable to FTP. This means that you can easily set up an FTP virtual account without adding system users to the system to avoid confusion with system users.

In addition, you can set quota, ratio, bandwidth, and other restrictions for these virtual users. These functions cannot be implemented by system user authentication. 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.

You can use an existing account of the system, such as the "nobody" user, as the system account of the virtual user. However, it is best to use a separate account, specifically for FTP. We chose to create a new system user. (after testing, if you use the ftp user that comes with the linux System in the linux system, the user will not be trusted when logging in with the virtual user. You can also perform experiments to see if this is the case ). The method is as follows:

For Linux/OpenBSD/NetBSD/Solaris/HPUX/or other Unix-like systems, run the following command:

Groupadd ftpgroup

Useradd-g ftpgroup-d/home/ftp-s/sbin/nologin ftpuser

For FreeBSD, run the following command:

# Pw groupadd ftpgroup

# Pw useradd ftpuser-g ftpgroup-d/home/ftp-s/sbin/nologin


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

2. Create a virtual user.

Use the "pure-pw" command to create, modify, and delete virtual users. The virtual user information is stored in the corresponding text file in one row for each user. You can also manually edit this file. The storage format is as follows:

: : : : : : : : : : : : :: :: :


In addition to accounts, passwords, uid, gid, and home directory, other values can be null values.

The following describes the usage of the pure-pw command.

[1] [2] [3] [4] Next page

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.