{"id":938,"date":"2023-05-25T07:49:03","date_gmt":"2023-05-25T07:49:03","guid":{"rendered":"https:\/\/www.dedicatedcore.com\/blog\/?p=938"},"modified":"2024-11-26T11:02:02","modified_gmt":"2024-11-26T11:02:02","slug":"install-ftp-server-ubuntu-vsftpd","status":"publish","type":"post","link":"https:\/\/www.dedicatedcore.com\/blog\/install-ftp-server-ubuntu-vsftpd\/","title":{"rendered":"How to Install FTP Server on Ubuntu with VSFTPD"},"content":{"rendered":"<p>The use of vsftpd (Very Secure FTP Daemon) to set up an FTP (File Transfer Protocol) server on your Ubuntu system. It makes it simple to exchange data between computers wirelessly. FTP is still a dependable way to share files, and vsftpd is renowned for its speed and security. Besides this, if you are looking to <a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-wireshark-ubuntu\/\" target=\"_blank\" rel=\"noopener\">grab network traffic<\/a> in a format that a normal human can go through understand how wireshark can be installed on Ubuntu.<\/p>\n<p>This article will show you how to install and set up vsftpd on an Ubuntu. So that you can have a reliable and effective FTP server ready for file transfers. It is impossible to match vsftpd&#8217;s simplicity for Ubuntu FTP server installation. When node.js hosting is <a href=\"https:\/\/www.dedicatedcore.com\/best-node-js-vps-hosting-mongodb\/\" target=\"_blank\" rel=\"noopener\">integrated with MongoDB<\/a> which offers\u00a0<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">a powerful\u00a0runtime setting<\/span> with a strong vps server for perfect execution.<\/p>\n<p>File Transfer Protocol is referred to as FTP. In that it specifies a language for data transport across a network, it is comparable to HTTP (HyperText Transport Protocol). FTP is a poor option for secure data transmission because it is by default not encrypted. This tutorial will assist you in setting up a vsftpd-based FTP server on Ubuntu. A DedicatedCore&#8217;s dedicated server is <a href=\"https:\/\/www.dedicatedcore.com\/dedicated-server-germany\/\" target=\"_blank\" rel=\"noopener\">the perfect platform<\/a> in Germany to get manageable hosting plans as per requirements.<\/p>\n<p><iframe loading=\"lazy\" title=\"How To Install an FTP Server in Ubuntu with VSFTPD\" width=\"719\" height=\"404\" src=\"https:\/\/www.youtube.com\/embed\/k3Z_dqe0PzY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h4>Requirements<\/h4>\n<ul>\n<li>Access to a sudo-privileged user account.<\/li>\n<li>(Ctrl-Alt-T) access to a terminal window or command line.<\/li>\n<li>The apt package manager is preinstalled.<\/li>\n<\/ul>\n<h2>Truncate File in Linux<\/h2>\n<h3>Step 1: Update System Packages First<\/h3>\n<p>Update your repositories first by typing the commands below in a terminal window:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update<\/pre>\n<p>The repositories are then updated by the system.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-940\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages.png\" alt=\"system updating repositories\" width=\"800\" height=\"211\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages-300x79.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages-150x40.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages-768x203.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages-100x26.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/update-system-packages-700x185.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Step 2: Set up the Ubuntu vsftpd Server<\/h3>\n<p>Vsftpd is a popular open-source FTP program used in Ubuntu. It is suggested because of how simple it is to use.<\/p>\n<p>1. Type the following command to install vsftpd:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt install vsftpd<\/pre>\n<p>This is an illustration of how Ubuntu output looks.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-942\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu.png\" alt=\"sudo apt install vsftpd command\" width=\"800\" height=\"570\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu-300x214.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu-150x107.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu-768x547.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu-100x71.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/install-vsftpd-ubuntu-632x450.png 632w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>2. Run the following commands to start the service and make it available at startup.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl start vsftpd\r\nsudo systemctl enable vsftpd<\/pre>\n<h3>Step 3: Backup Configuration Files in Step Below.<\/h3>\n<p>Back up your configuration files before making any alterations.<\/p>\n<p>1. Enter the following information to create a backup copy of the default configuration file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo cp \/etc\/vsftpd.conf \/etc\/vsftpd.conf_default<\/pre>\n<h3>Step 4: Create an FTP User after the above Step.<\/h3>\n<p>Make a new FTP user using the commands below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo useradd -m testuser\r\nsudo passwd testuser<\/pre>\n<p>For the newly created testuser account, the system ought to prompt you to enter a password.<\/p>\n<h3>Step 5: Configure Firewall to Allow FTP Traffic in Step<\/h3>\n<p>UFW, which is included with Ubuntu by default, will by default block FTP traffic. To enable FTP traffic on Ports 20 and 21, use the following commands:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo ufw allow 20\/tcp\r\nsudo ufw allow 21\/tcp<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-943\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic.png\" alt=\"sudo ufw allow command to configure firewall\" width=\"800\" height=\"211\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic-300x79.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic-150x40.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic-768x203.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic-100x26.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/configure-firewall-allow-ftp-traffic-700x185.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Step 6: Connect to the Ubuntu FTP Server with Command Below<\/h3>\n<p>Make a connection to the FTP server by using the next command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo ftp ubuntu-ftp<\/pre>\n<p>Change ubuntu-ftp to your system&#8217;s name (found on the command line). Use the testuser account and password you just created to log in. Your FTP server account should now be successfully logged in.<\/p>\n<h3>Setting Up and Protecting the Ubuntu vsftpd Server<\/h3>\n<h4>Modify the Default Directory<\/h4>\n<p>The \/srv\/ftp directory is used as the default directory for the FTP server by default. By making a new directory and altering the FTP user&#8217;s home directory, you can change this.<\/p>\n<p>Enter the following information to modify the FTP home directory:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo mkdir \/srv\/ftp\/new_location\r\nsudo usermod -d \/srv\/ftp\/new_location ftp<\/pre>\n<p>To make the modifications effective, restart the vsftpd service:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl restart vsftpd.service<\/pre>\n<p>The \/srv\/ftp folder (if you left it as the default) or the \/srv\/ftp\/new_location\/ directory (if you modified it) can now contain any files you choose to transfer through FTP.)<\/p>\n<h3>Identify FTP Users<\/h3>\n<p>The following information should be added to the vsftpd.conf file if you wish to allow authenticated users to upload files:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo nano \/etc\/vsftpd.conf<\/pre>\n<p>Change the value of the entry with the label &#8220;write_enable=NO&#8221; to &#8220;YES.&#8221;<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-944\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option.png\" alt=\"sudo nano write enable option in vsftpd\" width=\"800\" height=\"491\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option-300x184.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option-150x92.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option-768x471.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option-100x61.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/authenticate-ftp-users-write-enable-option-700x430.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>With the following, save the file, quit, and then restart the FTP service:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl restart vsftpd.service<\/pre>\n<p>The user is now able to edit files in their home directory.<\/p>\n<h3>Protecting FTP<\/h3>\n<p>Unsecured FTP servers are used as a target for numerous vulnerabilities. As a result, vsftpd.conf has many configuration options that can assist in safeguarding your FTP server.<\/p>\n<h4>User Access Limits<\/h4>\n<p>Limiting users to their home directory is one strategy. Uncomment the following command in an editor by opening the vsftpd.conf file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chroot_local_user=YES<\/pre>\n<p>An illustration of a nano file is shown here:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-945\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory.png\" alt=\"limit user access with chroot local user command\" width=\"800\" height=\"171\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory-300x64.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory-150x32.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory-768x164.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory-100x21.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/command-limit-users-home-directory-700x150.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Make a File Called User List<\/h3>\n<p>Edit \/etc\/vsftpd.chroot_list and add one user for each line to create a list file.<\/p>\n<p>By modifying vsftpd.conf, instruct your FTP server to restrict this list of users to their home directories:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chroot_local_user=YES\r\nchroot_list_file=\/etc\/vsftpd.chroot_list<\/pre>\n<p>The picture displays the changes that were made:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-946\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file.png\" alt=\"chroot local command to create user list file\" width=\"800\" height=\"311\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file-300x117.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file-150x58.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file-768x299.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file-100x39.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/create-user-list-file-700x272.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>Restarting vsftpd is necessary:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl restart vsftpd.service<\/pre>\n<p>The list of FTP users who have been blocked by default is kept in the file \/etc\/ftpusers. Edit this file and add one blocked user in each line to add additional users.<\/p>\n<h3>FTPS Traffic Encryption<\/h3>\n<p>Encrypting the traffic on your FTP server is another way to make it secure. FTPS, or File Transfer Protocol over SSL (Secure Socket Layer), is used to do this.<\/p>\n<p>Users must be given shell accounts on the FTP server for this to function. Your FTP communication will get a layer of safe encryption as a result.<\/p>\n<p>1. Begin by using openssl to create a new certificate. Run the following command to do so:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/vsftpd.pem -out \/etc\/ssl\/private\/vsftpd.pem<\/pre>\n<p>2. When requested, enter the necessary information to maintain the default settings.<\/p>\n<p>3. After that, update the vsftpd.conf file and replace the line ssl_enable=NO to ssl_enable=YES:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">ssl_enable=YES<\/pre>\n<p>4. After that, insert the following text:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">rsa_cert_file=\/etc\/ssl\/private\/vsftpd.pem\r\nrsa_private_key_file=\/etc\/ssl\/private\/vsftpd.pem\r\nallow_anon_ssl=NO\r\nforce_local_data_ssl=YES\r\nforce_local_logins_ssl=YES\r\nssl_tlsv1=YES\r\nssl_sslv2=NO\r\nssl_sslv3=NO\r\nrequire_ssl_reuse=NO\r\nssl_ciphers=HIGH\r\npasv_min_port=40000\r\npasv_max_port=50000<\/pre>\n<p>5. Save your modifications and close the document.<\/p>\n<p>6. To apply the changes, restart the service:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl restart vsftpd.service<\/pre>\n<h4>Final Thought on Installing an FTP Server On Ubuntu with vsftpd<\/h4>\n<p>Creating an FTP server on your Ubuntu system with vsftpd installation offers a reliable option for file sharing and transfer requirements. You have successfully installed vsftpd and learned how to set up and secure your FTP server by following the instructions in this article. Now that you have access to a trustworthy and secure file transfer system, you may easily share files with others via your Ubuntu network.<\/p>\n<p>Your vsftpd-powered FTP server is a useful addition to your Linux-based infrastructure, whether it is used for private purposes or in a professional setting. By this point, vsftpd should have been used to install an FTP server on Ubuntu. Now that your user lists and accounts have been set up, you should be able to login to your new FTP server. We also went into detail about the dangers of the FTP protocol and how to avoid them. Hope you got a clear idea for installing the FTP server Ubuntu.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The use of vsftpd (Very Secure FTP Daemon) to set up an FTP (File Transfer Protocol) server on your Ubuntu system. It makes it simple&#8230;<\/p>\n","protected":false},"author":1,"featured_media":981,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/938"}],"collection":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":14,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"predecessor-version":[{"id":2580,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/938\/revisions\/2580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media\/981"}],"wp:attachment":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}