FTP service Construction

Source: Internet
Author: User
Tags ftp login ftp client

FTP
There is a server that acts as an FTP server and specifies that a directory is shared. When the client connects to the server, it can directly download and upload the file in the shared directory.

The server needs to install the vsftpd command, the client needs to install the FTP command, and the client uses the FTP command to log on to
FTP user types
1. Anonymous Users
The shared file is the/var/FTP/pub directory, and the Directory should change its owner to FTP

After vsftpd is installed, you will naturally find the/etc/vsftpd. conf: ftp configuration file.
27 anon_upload_enable = Yes enable upload permission for anonymous users
28 anon_umask = 022 manually add other write permissions for anonymous users
32 anon_mkdir_write_enable = Yes enable Anonymous users to create directories
33 anon_other_write_enable = Yes manually add other write permissions for anonymous users (delete and rename)
2. Local User
The shared directory is the home directory of the account.
22 local_umask = 077 modify the local user's default permission mask to 077
96 chroot_local_user = Yes enable local user's home directory lock

Because it is an FTP local user service, you need to first create a common user and password to log on to the server using the client ftp and enter the yunjisuan account and password

Then perform the test.
3. Virtual users

First, check whether the system has the db_load command. If not, you need to install the FTP virtual user. First, you need to create a password file under/etc/vsftpd.

After the password file is created, you need to run the db_load command to convert it to a data file.-T allows non-programs to use the database-T specified algorithm hash-F to encrypt the password, to increase security, chmod 600 vusers is required. DB permission

First, create a virtual ing account. Because the home directory is specified, manually create a home directory and grant 755 permissions.

 

Manually create the PAM Authentication file as follows:

Set the bottom configuration file

After the service is configured and restarted, you can use the client for FTP login. Because the created home directory is specified, you need to create a dot file in/var/ftproot.

 

Log on to the server using the FTP client, and enter the manually created virtual account password to view the file created in the home directory of the server.

Because I just created two account passwords, I logged on with the Second Account and saw the specified server directory file.

To control different root directories and permissions of each virtual user, first create the mkdir/vusers. dir directory in/etc/vsftpd and enter the name in the touch virtual account directory.

Vim manually opens/etc/vsftpd/vusers. DIR/virtual account name

After the manual mkdir-P/var/virtual account name is configured, chown virtual/var/virtual Account name: Replace the account owner with the virtual account with the read and write permissions.

 

At the end, manually fill in/etc/vsftpd. conf

Restart the service/etc/init. d/vsftpd reload and enter the test environment. manually create files in the home directory of the server.

 

Log on to a virtual user through the FTP client. The file is exactly the one created in the configuration file directory of the server.

 

FTP service Construction

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.