Setting up an FTP server on Ubuntu.
To set up an FTP server on Ubuntu, follow these steps:
- Install the vsftpd service.
sudo apt update
sudo apt install vsftpd
- Configure the vsftpd service:
- Open the main vsftpd configuration file:
sudo nano /etc/vsftpd.conf
- Ensure the values of the following configuration items are set to the following content:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
- Uncomment the following configuration item and set it to the following content:
user_sub_token=$USER
local_root=/home/$USER/ftp
- Save and close the file.
- Create FTP user:
sudo adduser ftpuser
Set up user password and other information according to the prompts.
- Create FTP directory and grant user permission.
sudo mkdir /home/ftpuser/ftp
sudo chown nobody:nogroup /home/ftpuser/ftp
sudo chmod a-w /home/ftpuser/ftp
- Restart the vsftpd service:
sudo systemctl restart vsftpd
The FTP server has been set up now. You can connect to the server using an FTP client and transfer files with the new user that has been created.