FTP Server Configuration on CentOS
**Subject:** SNA Lab
**Submitted to:** Mam Misbah Jabeen
**Submitted by:** M. Nouman
**University:** University of Sargodha, Pakistan
Objective
To configure and secure an FTP server on a CentOS system using vsftpd (Very Secure FTP
Daemon).
Steps to Configure FTP Server
1. Install vsftpd
1. Update your system packages:
sudo yum update
2. Install vsftpd:
sudo yum install vsftpd
2. Configure vsftpd
1. Open the vsftpd configuration file:
sudo nano /etc/vsftpd/vsftpd.conf
2. Make the following changes for a secure FTP server:
Disable anonymous login: anonymous_enable=NO
Enable local user access: local_enable=YES
Allow file uploads: write_enable=YES
Restrict users to their home directories: chroot_local_user=YES
Define passive port range: pasv_min_port=30000, pasv_max_port=31000
3. Save and close the file.
3. Add FTP User
1. Create a new user for FTP access:
sudo adduser ftpuser
sudo passwd ftpuser
2. Create directories for the FTP user:
mkdir -p /home/ftpuser/ftp/uploads
chmod 550 /home/ftpuser/ftp
chmod 750 /home/ftpuser/ftp/uploads
chown -R ftpuser:ftpuser /home/ftpuser/ftp
4. Open Firewall Ports
Allow FTP traffic through the firewall:
sudo firewall-cmd --permanent --add-port=21/tcp
sudo firewall-cmd --permanent --add-port=30000-31000/tcp
sudo firewall-cmd --reload
5. Start and Enable vsftpd
1. Start the vsftpd service:
sudo systemctl start vsftpd
2. Enable it to start on boot:
sudo systemctl enable vsftpd
6. Test the FTP Server
1. Use an FTP client (e.g., FileZilla) to connect to the server.
2. Provide the server's IP address, username (ftpuser), and password to test.
Conclusion
This configuration sets up a secure and functional FTP server on CentOS. Additional security
measures, such as enabling SSL/TLS for encrypted connections, can be implemented for
enhanced protection.