Linux——FTP file transfer service

  • Personal profile: Cloud computing network operation and maintenance professionals, understand operation and maintenance knowledge, master TCP/IP protocol, share network operation and maintenance knowledge and skills every day.
  • Motto: The sea does not shy away from water, so it can become big; the mountain does not shy away from stones, so it can grow taller.
  • Personal homepage: Xiaolihui Technology's homepage 
     


Table of contents

 Foreword:

1. FTP file transfer service introduction

  2. Build FTP file transfer service

1. Install vsftpd:

 2. Edit the configuration file:

 3. Restart the service:

4. Set FTP user:

5. Test:

3. Theoretical analysis - the main points of the article

4. Build FTP service based on virtual users 

1. Create account data

 2. Add virtual user support

 3. Start the service and test 


 Foreword:

The Linux operating system provides a variety of FTP (File Transfer Protocol) file transfer services, including commonly used vsftpd and proftpd

1. FTP file transfer service introduction

FTP (File Transfer Protocol) is a common file transfer protocol used to transfer files between computers. The Linux operating system provides a variety of FTP file transfer services. Through these services, you can build an FTP server on the Linux system, so that other computers can access files through the FTP protocol.

Common Linux FTP services include vsftpd, proftpd, etc., among which vsftpd is one of the most commonly used FTP services. vsftpd is a very lightweight, fast, and secure FTP server originally designed for Red Hat, and now it has become the default FTP server for almost all Linux distributions.
 


  2. Build FTP file transfer service

1. Install vsftpd:

sudo apt-get install vsftpd

 2. Edit the configuration file:

sudo vim /etc/vsftpd.conf

 3. Restart the service:

sudo service vsftpd restart

4. Set FTP user:

When adding an FTP user, be sure to add it to the appropriate user group

sudo adduser ftpuser
sudo usermod -aG ftp ftpuser

5. Test:

Use FTP software to connect to the FTP server for testing, enter the user name and password to access.

The above is the basic process of setting up the FTP file transfer service on the Linux system, and the specific operation can be adjusted according to the actual situation.


3. Theoretical analysis - the main points of the article

  • FTP connection method (type): ***
  • Control connection: TCP 21, used to send FTP command information
  • Data connection: TCP 20, for uploading and downloading data
     
  • FTP connection mode: ***
  • Active mode: the server actively initiates a connection to the client from port 20 (the server actively connects to the client)
  • Passive mode: the server passively waits for the client connection on a certain port within the specified range (the client actively connects to the server)

  • FTP transfer mode: ***
  • text mode, binary mode
     
  • Type of FTP user: ***
  • anonymous user, local user, virtual user

  • The main configuration file of Vsftpd:
  •  /etc/vsftpd/vsftpd.conf
     
  • anonymous: anonymous
  •    local: local
  •   Daemon: daemon process; daemon

4. Build FTP service based on virtual users 

1. Create account data

  • Create account database files for virtual FTP users
  • Create FTP root directory and system user for virtual user mapping
  • Create a PAM authentication file that supports virtual users

 2. Add virtual user support

  • Add support configuration in vsftpd.conf file
  • Create separate configuration files for individual virtual users 

 3. Start the service and test 

  • Reload vsftpd configuration
  • Use a virtual FTP account to access the test

If you have wings, you should fly, and if you have dreams, you should chase them
. Thank you for your support and attention. Like and collect~~~Welcome to CSDN

Guess you like

Origin blog.csdn.net/m0_64292323/article/details/131365304