How to enable FTP access on an Ubuntu machine.

  • This topic is empty.
  • Post
    Weekend Wiki
    Keymaster
    To enable FTP access on an Ubuntu machine, follow these steps:


    Step 1: Install an FTP Server

    1. Open Terminal on your Ubuntu machine.
    2. Update the package list and install vsftpd (a lightweight FTP server):
      sudo apt update
      sudo apt install vsftpd -y
      

    Step 2: Configure vsftpd

    1. Open the FTP server configuration file:
      sudo nano /etc/vsftpd.conf
      
    2. Edit the file to configure the FTP server:
      • Allow local users to log in: Uncomment the line:
        local_enable=YES
        
      • Enable write access: Uncomment the line:
        write_enable=YES
        
      • Disable anonymous FTP access: Ensure this line is set:
        anonymous_enable=NO
        
      • Enable FTP access to a specific directory (optional): Add the following line to restrict FTP users to their home directories:
        chroot_local_user=YES
        
    3. Save the changes (press Ctrl+O, then Enter, followed by Ctrl+X).
    4. Restart the FTP server to apply the changes:
      sudo systemctl restart vsftpd
      

    Step 3: Configure Firewall (if applicable)

    1. If the firewall is active (ufw), allow FTP traffic:
      sudo ufw allow 21
      sudo ufw enable
      
    2. Verify the rules:
      sudo ufw status
      

    Step 4: Create an FTP User (if needed)

    1. Add a new user:
      sudo adduser ftpuser
      
    2. Set a password for the user during the prompt.

    Step 5: Access FTP

    1. Use an FTP client like FileZilla, WinSCP, or a command-line FTP client to connect.
    2. Connection details for the client:
      • Host: The IP address of your Ubuntu machine.
      • Username: The FTP user’s username (e.g., ftpuser).
      • Password: The password you set.
      • Port: 21 (default FTP port).

    Optional: Enable Secure FTP (FTPS)

    For encrypted connections, enable FTPS:

    1. Open the configuration file:
      sudo nano /etc/vsftpd.conf
      
    2. Uncomment or add the following lines to enable SSL:
      ssl_enable=YES
      rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
      rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
      
    3. Restart the FTP server:
      sudo systemctl restart vsftpd
      

    Now your FTP server is ready for use!

     

    If still you’re not able to do so, connect with us at [email protected]

  • You must be logged in to reply to this topic.
en_USEnglish