How to set up an FTP server on Ubuntu Linux

Author: Louise Ward
Date Of Creation: 10 February 2021
Update Date: 1 July 2024
Anonim
[How To] Install FTP Server (VSFTPD) on Ubuntu 20.04 (2020) #1
Video: [How To] Install FTP Server (VSFTPD) on Ubuntu 20.04 (2020) #1

Content

This wikiHow teaches you how to set up and connect to an FTP server on a computer running Ubuntu Linux. FTP servers are very useful for storing data from your computer and allowing others to browse through those files. To establish a connection from your computer, you need an FTP server. You also need to update to the latest Ubuntu version.

Steps

Part 1 of 4: Installing the FTP framework

  1. Make sure your Ubuntu version is up to date. Ubuntu versions 17.10 and above have a lot of different file paths than previous versions, so you'll need to update to the latest Ubuntu version:
    • Open Terminal
    • Enter an ordersudo apt-get upgrade then press ↵ Enter.
    • Enter the password and tap ↵ Enter.
    • Import y appears, then press ↵ Enter.
    • Wait for the upgrade to finish installing, then restart your computer if prompted.

  2. Open Terminal. Click the menu Applications⋮⋮⋮, scroll down and click the icon Terminal to start.
    • You can also press Alt+Ctrl+T to open Terminal.

  3. Enter the VSFTPD install command. Enter an order sudo apt-get install vsftpd into Terminal, then press ↵ Enter.

  4. Enter password. Enter the password that you use to log into your computer, then tap ↵ Enter.
  5. Wait for VSFTPD to install. This will take about 5-20 minutes depending on your FTP setup and Internet connection, so be patient.
  6. Install FileZilla. This is the program that you will use to access and upload data to your server. To install, please:
    • Enter an order sudo apt-get install filezilla
    • Re-enter your password if prompted.
    • Wait for the installation to complete.
    advertisement

Part 2 of 4: Configuring the FTP server

  1. Open the VSFTPD configuration file. Enter an order sudo nano /etc/vsftpd.conf and press ↵ Enter. You will need to edit this file to enable (or disable) specific VSFTPD features.
  2. Allow local users to log into the FTP server. Use the arrow keys and scroll down to the title # Uncomment this to allow local users to log in. , then remove the "#" from the line local_enable = YES below.
    • You can remove the "#" using the arrow keys and select the letter in front of the pound sign (in this case, "l") and then press the key ← Backspace.
    • Skip this step if the line local_enable = YES without pound sign.
  3. Allow FTP to write commands. Scroll down to the title # Uncomment this to enable any form of FTP write command., then remove the "#" from the line write_enable = YES below.
    • Skip this step if the line write_enable = YES without pound sign.
  4. Disable ASCII disturbance. Scroll down to the title # ASCII mangling is a horrible feature of the protocol., then remove the "#" from the following two lines:
    • ascii_upload_enable = YES
    • ascii_download_enable = YES
  5. Change the "chroot" setting. Scroll down to the title # chroot), then add the following lines:
    • user_sub_token = $ USER
    • chroot_local_user = YES
    • chroot_list_enable = YES
    • If any of the above lines already exist, simply delete the "#" in front of those lines.
  6. Change default "chroot" settings. Scroll down to the title (default follows), then add the following lines:
    • chroot_list_file = / etc / vsftpd.chroot_list
    • local_root = / home / $ USER / Public_html
    • allow_writeable_chroot = YES
    • If any of the above lines already exist, simply delete the "#" in front of those lines.
  7. Turn on the option "ls recursive function". Scroll down to the title # You may activate the "-R" option ..., then remove the "#" from the line ls_recurse_enable = YES below.
  8. Save and exit a text editor. To do this, you:
    • Press Ctrl+X
    • Import y
    • Press ↵ Enter
    advertisement

Part 3 of 4: Adding username to chroot list

  1. Open the "chroot" text file. Enter an order sudo nano /etc/vsftpd.chroot_list and press ↵ Enter.
    • You can skip and go to the last step in this section if you do not need to specify who can access the FTP server.
  2. Enter password. Enter the password you use to log into Ubuntu, then click ↵ Enter. The "chroot" text file will open.
    • Skip this step if the system doesn't ask you to enter your password.
  3. Add username to the list. Enter your username, then tap ↵ Enter, then repeat for the usernames that own the Home folder you want to access right on your server.
  4. Save the list. Press Ctrl+X, import y then press ↵ Enter. Your list will be saved.
  5. Restart VSFTPD. Enter an order sudo systemctl restart vsftpd then press ↵ Enter. The VSFTPD will restart to ensure that your changes have been saved. You should now be able to access the FTP server. advertisement

Part 4 of 4: Accessing the server

  1. Determine the server's address. If you purchased an FTP server through a third party service (for example, Bluehost), you will need to know the service's IP address or a regular address in order to connect.
    • If you are keeping a private server on your computer then will need the computer IP address, enter the commandifconfig Go to Terminal and see the number "inet addr" in the output.
      • If "ifconfig" is not installed, you can enter command sudo apt-get install net-tools Go to Terminal to install.
  2. Port forwarding on the router. Once you know the server IP address, you'll need to forward your router's 21-slot port to that address; Make sure this port uses TCP protocol (not UDP or combination type).
    • The port forwarding process will vary depending on the router, you should refer to the relevant article or the router documentation for instructions.
  3. Open Filezilla. Import filezilla Go toerminal, then press ↵ Enter. After a moment, FileZilla will open.
    • If you want to connect via Terminal, you can try entering commands ftp . As long as the FTP server is up and running and you have Internet access, the system will try to connect to the server; however, you may not be able to upload the file.
  4. Click File in the upper left corner of the FileZilla window. A drop-down menu will appear.
  5. Click Site Manager ... (Site Manager). This option is in the drop-down menu. The Site Manager window will open.
  6. Click New Site (New page). This white button is in the lower left of the window. The New Site section will open on Site Manager.

  7. Enter the server address. Enter the address (or IP address) of the FTP server you want to connect to in the "Host:" field.
  8. Add the port number to be forwarded. Import 21 enter the "Port:" field.

  9. Click Connect (Connect). This red button is at the bottom of the page. FileZilla will connect the computer to the FTP server.
  10. Transfer files to the server. You can drag the folder in the left pane and drop it on the right window to upload the data to the FTP server page. advertisement

Advice

  • Port 20 forwarding can solve some network problems if you are keeping your server private.
  • The process of connecting to an FTP server on Ubuntu 17 and above will be slightly different from previous versions, so you'll need to update Ubuntu to version 17.10 (or higher) if you haven't already.

Warning

  • An FTP server is not always secure, especially if you are keeping your own server. Therefore, you should refrain from uploading personal / sensitive information to FTP servers.