How to set up an FTP server on Linux?
To set up an FTP server, you can follow these steps:
- Install the vsftpd (Very Secure FTP Daemon) software package, which is a popular FTP server software. Enter the following command in the terminal to install vsftpd:
sudo apt-get update
sudo apt-get install vsftpd
- After installation, edit the vsftpd configuration file. You can open and edit the file using the following command:
sudo nano /etc/vsftpd.conf
- In the configuration file, you can make various settings, such as allowing anonymous login, setting the FTP root directory, etc. Below are some common configuration options:
- Enable anonymous login for FTP server.
- local_enable=YES: Allows local users to log in to the FTP server.
- write_enable=YES: Allows users to upload files to the FTP server.
- chroot_local_user=YES: Limits a user’s access to their home directory only.
Configure according to your needs and save the file.
- Restart the vsftpd service to apply changes. Use the following command to restart the vsftpd service:
sudo service vsftpd restart
- Configure the firewall to allow FTP traffic through. If you are using the ufw firewall, you can use the following command to open FTP ports:
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
- Once you have completed the above steps, your FTP server should be set up and ready to use. You can connect to the server using any FTP client software and access it using your login credentials.
These are the basic steps, additional configurations may be necessary depending on your needs and specific environment. Please refer to the documentation for vsftpd or other resources for more detailed information.