Home  >  Article  >  Computer Tutorials  >  Ubuntu system uses vsftpd to build FTP server.

Ubuntu system uses vsftpd to build FTP server.

WBOY
WBOYforward
2024-02-18 17:50:13383browse

Ubuntu system uses vsftpd to build FTP server.

To use vsftpd to build an FTP server on the Ubuntu system, you can follow the following steps:

  1. Install vsftpd:

    Open a terminal and execute the following command to install vsftpd:

    sudo apt update
    sudo apt install vsftpd
  2. Configure vsftpd:

    Use a text editor (such as nano or vi) to open the vsftpd configuration file:

    sudo nano /etc/vsftpd.conf

    In the configuration file, you can make the following changes or add as needed:

    • Enable anonymous access (if required):

      anonymous_enable=YES
    • Disable anonymous uploads (if desired):

      anon_upload_enable=NO
    • Enable local user access:

      local_enable=YES
    • Set the list of users allowed to log in:

      userlist_enable=YESuserlist_file=/etc/vsftpd.userlistuserlist_deny=NO
    • If you want to restrict users to their home directories, uncomment the following line:

      chroot_local_user=YESchroot_list_enable=YESchroot_list_file=/etc/vsftpd.chroot_list
    • Save and close the file.
  3. Create user:

    If you want to allow local users to access the FTP server, you can create an FTP user. Execute the following command to create a new user:

    sudo adduser ftpuser

    Set the username and password according to the prompts.

  4. Start the vsftpd service:

    Execute the following command to start the vsftpd service:

    sudo systemctl start vsftpd
  5. Configure firewall:

    If your system has a firewall enabled (such as ufw), you need to open the FTP data port. Execute the following command to allow FTP transfer:

    sudo ufw allow 20/tcpsudo ufw allow 21/tcp
  6. Verify FTP server:

    Use an FTP client on another computer to connect to your FTP server and log in using the user credentials you created. You should be able to successfully connect to the FTP server and access your files.

Now you have successfully set up an FTP server using vsftpd on the Ubuntu system. Please note that these steps are for Ubuntu systems, if you are using another Linux distribution, please consult the corresponding documentation or guide.

The above is the detailed content of Ubuntu system uses vsftpd to build FTP server.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete