Setting up FTP Server on Ubuntu

Instructions refered from here and here.

Installation

Install the TFTP Server

sudo apt-get install tftpd-hpa

Once the installation is complete, you will have a running TFTP server on your system that will be listening on all active network interfaces, on both IPv4 and IPv6. All you will be able to do is download files from the TFTP server. Uploading will not work. We will fix that in the Configuration section below.
You can confirm this by running…

sudo service tftpd-hpa status

and/or

netstat -a | grep tftp

The default configuration file for tftpd-hpa is /etc/default/tftpd-hpa.
The default root directory where files will be stored is /var/lib/tftpboot.

Configuration

As mentioned before, all you will be able to do at this point is download files from the TFTP server. If you want to upload to the TFTP server, read on. To begin with, make a copy of the default tftpd-hpa configuration file.

sudo cp /etc/default/tftpd-hpa /etc/default/tftpd-hpa.ORIGINAL

Then, edit the tftpd-hpa configuration file.

sudo vi /etc/default/tftpd-hpa

and change the line that reads…

TFTP_OPTIONS="--secure"

to

TFTP_OPTIONS="--secure --create"

and save the file and exit the vi editor.

Modify Permissions on TFTP Root Directory

The root directory where files must be stored in order to access them via TFTP is /var/lib/tftpboot. If you want to be able to upload to that directory, then perform the following command.

sudo chown -R tftp /var/lib/tftpboot

if this does not work try

sudo chmod -R 777 /var/lib//tftpboot

To make the changes take effect, the tftpd-hpa service must be restarted. This can be accomplished by performing the following command.

sudo service tftpd-hpa restart

At this point you should now have a TFTP server that allows you to both download and upload files.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: