How to setup an FTP server on Linux.

Support Article

Below you will find the information regarding how to setup and configure a FTP server on your node

If you've never installed any packages before on your system it might be best to quickly take a read on our guide for installing packages here -

CentOS / RHEL / Fedora distributions:

To start you're going to need to issue to command: yum -y install vsftpd Once the process has completed your system should have automatically started the vsftpd process. What we now want to do is use the command, In order to stop the service so we can go ahead and make some configuration changes.
service vsftpd stop We're now going to go ahead and use a pre-packed application with RHEL distributions called vi. Vi is very similar to Notepad on Windows. It's a text editor that you can use to edit configuration files etc, if you need more help with Vi, you can follow this guide. Now you're going to need to proceed with the following command to bring up the configuration file for vsftpd:
vi /etc/vsftpd/vsftpd.conf To navigate around whilst in vi you will need to use your arrow keys on your keyboard. If you would like you make any changed you will need to press i on your keyboard to enable the insert mode allowing you to add / edit / remove text. For example, I want to enable write_enable as it's currently set to write-enable=NO. I would simply change NO to YES whilst in the insert mode.

Once you're done with any changes you want to make press the ESC key on your keyboard and then type :wq to write to the file saving any changes you've made and then quit from using vi.
Then we're going to need to start the FTP server back up so we would use the following command to do this:
service vsftpd start

Ubuntu / Debian distributions:

To start we're going to need to issue a command which will update our current package list telling us what packages there are that we can install from the repository:
apt-get update After we've issued this command we can go ahead and proceed to install the VSFTPD package by issuing the following command:
apt-get -y install vsftpd Once installed we want to stop the FTP server from running, to do this we would issue the following command:

Ubuntu:

service vsftpd stop

Debian:

/etc/init.d/vsftpd stop Once stopped we can proceed to edit the vsftpd configuration file. To do this we're going to use a package that comes with both these distributions called nano much alike vi we can edit text in our configuration files.
Proceed entering the following command:
nano /etc/vsftpd.conf This will then bring up the nano editor with the vsftpd configuration file loaded up inside of it. Unlike using vi we don't need to enter the insert mode to change anything in our configuration file we can simply edit it like we would if we were using Notepad for example.

Once you've gone ahead and made all the changes you wanted to save and exit from nano you simply press and hold your CTRL key + x and then press y to save the changes followed by the enter key.

In order to start the FTP server back up we would issue the following commands:

Ubuntu:

service vsftpd start

Debian:

/etc/init.d/vsftpd start If you're having any problems connecting to your FTP server you may want to try turning off iptables or ubuntu firewall to test. You can do this by issuing one of the following commands depending on the distribution you're running.

IPTables:

service iptables stop (To start again service iptables start)

Ubuntu Firewall:

ufw disable (To re-enable ufw enable) If it turns out it was a problem with either IPTables or Ubuntu firewall, please take a look at our tutorial on how to add firewall rules here

Unable to find the answer you're looking for? Get in touch today!

Get in touch