Set up an FTP service on Ali cloud ECS server

I. Introduction

FTP is a file transfer protocol for bidirectional transmission over the Internet files between the server and the client. FTP is a TCP / IP protocol, using default 20 and 21 ports, a port 20 for transmitting data, a port 21 for transmission of control information. This article is to build a FTP server service in the cloud Ali ECS above.

Second, the environmental profiles

  • Server's operating system: Ubuntu 18.04 64-Wei
  • Software used: linux is set up ftp server software commonly used vsftpd

Third, step up an FTP server

1, the configuration server security group policy ECS

Under ECS server is not configured by defaultFTP uses port 20/21Security policy, and therefore we must first add the corresponding port access policy, which would allow clients to connect to an FTP server on top of the Internet.
Here Insert Picture Description

  • Add the security group rules, as follows:
    Here Insert Picture Description
  • After configuration, reboot the server update settings.

2, server software installed vsftpd

  • With xshell to root identity (non-root users can, but only if the user belongs to the sudo group, have root privileges.) Log on to the server, in turn enter the following command:
apt-get update
apt-get install vsftpd

Implementation of the above command to complete the installation vsftpd tool.
If the non-root user, can be added in front of the above command sudo temporarily get root privileges.

3, modify the configuration file

vsftpd tool configuration file located in the / etc directory, the file name vsftpd.conf .

  • Open the file in the vi editor, enter the command:
vi /etc/vsftpd.conf
  • Open the file, you can modify the basic configuration of the server, the following modifications to some of the basic settings:
    Here Insert Picture Description
    Here Insert Picture Description

4, start the FTP service

After setting up the vsftpd configuration file tool, you can start the service. It is recommended not to use the root account to start the service, because the root account without a user folder in the / home directory, direct startup error.

  • Can create a new account, and then give root privileges, root account execute the following command:
adduser hello
  • Then follow the prompts to enter a password to create a new user, then the user has not root privileges, execute:
sudo  usermod -aG sudo hello

Hello account will be assigned to the sudo group, so that you can use the sudo command to temporarily gain root privileges.

  • Hello then switch to the user, execute:
sudo service vsftpd start

Open the ftp service on the line.

5, log on to the FTP server for Windows

Because ECS server supports only log on to the server in an active mode, the computer must first modify the above to the login server in passive mode.

  • Open the Control Panel -> Internet Options -> Advanced, as follows:
    Here Insert Picture Description
    find the use of passive FTP uncheck, click Apply.

  • The following open windows explorer, entered in the input fieldftp://x.x.x.x(Server ip address), as shown below:
    Here Insert Picture Description
    In the current page, click the right mouse button -> Login, enter the account number and password to start the FTP service , you can log on to the server. If the previous configuration anonymous login, you can also enter the account number: anonymous, password is blank, log on to the anonymous account.

Released five original articles · won praise 1 · views 733

Guess you like

Origin blog.csdn.net/HelloWorldTM/article/details/104634864