setting-up-ftp

1 Creating an FTP User

  1. Install vsftpd on the server:
    sudo apt update && sudo apt install vsftpd -y
  2. Create a new user for FTP access:
    sudo adduser ftpuser
  3. Assign proper directory permissions:
    sudo mkdir -p /home/ftpuser/ftp
    sudo chown nobody:nogroup /home/ftpuser/ftp
    sudo chmod a-w /home/ftpuser/ftp
    The ftp directory is created and owned by nobody:nogroup to restrict write access.

2 Configuring FTP Access

  1. Open the vsftpd configuration file:
    sudo nano /etc/vsftpd.conf

Modify the following settings:

    anonymous_enable=NO
    local_enable=YES
    chroot_local_user=YES
    allow_writeable_chroot=YES
  1. Restart the FTP service to apply changes:
sudo systemctl restart vsftpd
  1. Enable FTP service on boot:
sudo systemctl enable vsftpd

3 Testing FTP Connectivity

  1. Verify that the FTP server is running:
sudo systemctl status vsftpd

Use an FTP client such as command-line FTP to test access:

ftp ftpuser@<server-ip>
  1. Log in with the credentials of the created user.