Detailed steps to build an FTP server on Ubuntu
Build an FTP server on Ubuntu to meet file transfer and management needs. The following are the detailed steps to build: 1. Install vsftpd: First you need to install an FTP server package called vsftpd. Enter the following command in the terminal to install: ```bash sudo apt-get update sudo apt-get install vsftpd ``` 2. Configure vsftpd: After the installation is complete, vsftpd needs to be configured. Edit the configuration file/etc/vsftpd.conf, you can use a text editor like nano or vim. In the configuration file, various parameters can be modified as needed, such as allowing anonymous access, setting upload and download restrictions, etc. 3. Restart the vsftpd service: After modifying the configuration, you need to restart the vsftpd service for the changes to take effect. Enter the following command in the terminal: ```bash sudo systemctl restart vsftpd ``` 4. Set firewall rules: If the server has a firewall enabled, the port that allows the FTP service is required. Enter the following command in the terminal: ```bash sudo ufw allow 20/tcp sudo ufw allow 21/tcp ``` 5. Create FTP users: In order to use FTP services, one or more FTP users need to be created. The useradd and passwd commands can be used to create users and set passwords. For example, create a user named ftpuser and set the password to mypassword: ```bash sudo useradd ftpuser sudo passwd ftpuser ``` 6. Authorized FTP user: In order to allow the newly created user to use the FTP service, it needs to be added to the authentication file of vsftpd. Edit the/etc/vsftpd.user _ list file and add the information of the new user: ```bash sudo nano /etc/vsftpd.user_list ``` Add the following to the file (replace ftpuser with the actual username): ``` ftpuser mypassword*=*,NOPASSWD:ALL ``` Save and exit the editor. So far, an efficient and stable FTP server has been built on Ubuntu, which can meet the needs of file transfer and management.