Flag This Hub

How to set up a TFTP server in Ubuntu

By


TFTP (Trivial File Transfer Protocol) is a stripped down file transfer protocol. Unlike the commonly used FTP it does not contain authentication and is not suitable for use over the public internet. It is mainly used for serving boot files to embedded devices.

Install tftpd-hpa and supporting packages.

sudo apt-get install xinetd tftpd-hpa tftp-hpa

Make the tftp storage directory writeable by 'normal' users

sudo chmod -R 777 /var/lib/tftpboot

Create /etc/xinetd.d/tftp and add the following contents:

service tftp
{
	protocol        = udp
	port            = 69
	socket_type     = dgram
	wait            = yes
	user            = nobody
	server          = /usr/sbin/in.tftpd
	server_args     = /var/lib/tftpboot
	disable         = no
}

Start tftp daemon through xinetd

sudo /etc/init.d/xinetd start

Now test that your tftp server is working by getting a file from your own ip address.

user@ubuntu:~$ echo "This is a test file for tftp." >> /var/lib/tftpboot/testfile.txt
user@ubuntu:~$ tftp <YOUR IP HERE>
tftp> get testfile.txt
tftp> quit
user@ubuntu:~$ cat testfile.txt 
This is a test file for tftp.

Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working