Installing and Testing TFTPD Server in Ubuntu
1. Install following packages.
$ sudo apt-get install xinetd tftpd tftp
2. Create /etc/xinetd.d/tftp and put this entry
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
3. Create a folder /tftpboot this should match whatever you gave in server_args. mostly it will be tftpboot
$ sudo mkdir /tftpboot $ sudo chmod -R 777 /tftpboot $ sudo chown -R nobody /tftpboot
4. Restart the xinetd service.
$ sudo /etc/init.d/xinetd stop $ sudo /etc/init.d/xinetd start
Now our tftp server is up and running.
Testing our tftp server
5. Create a file named test with some content in /tftpboot path of the tftp server
$ ls / > /tftpboot/test $ sudo chmod -R 777 /tftpboot $ ls /tftpboot/test -lh -rw-r--r-- 1 thalib thalib 159 2010-03-05 20:48 test
Obtain the ip address of the tftp server using ifconfig command, in this example we will consider the ip address as 192.168.1.2
6. Now in some other system follow the following steps.
$ tftp 192.168.1.2 tftp> get test Sent 159 bytes in 0.0 seconds tftp> quit $ ls test -lh -rw-r--r-- 1 thalib thalib 159 2010-03-05 20:48 test
Thats it. Our tftp server is working fine.





May 21, 2012 at 3:45 PM
When i’m trying to create file in that directory:
:/etc/xinetd.d$ sudo cat > tftpd
bash: tftpd: Permission denied
i’m using Ubuntu 12.04, i tried this in windows style, both with failure, i am so frustrated ARGHH
February 1, 2012 at 12:48 PM
Hi can anyone help me setting up tftp file transfer between two linux PCs?
Pls provide exact steps for the same.
1.should the both systems be connected thro cables?
2.how to install tftp client?
3.how to transfer the files between them?
February 1, 2012 at 2:09 PM
You can use the above steps in the blog.
1. In both PC’s execute all the above steps
2. Then run to test tftp transfer between the PC’s only execute step 6, but use opposite PC’s IP here.
Answer for your question.
1.should the both systems be connected thro cables?
As long as both the PC’s are in the same net work, or they are able to ping them each other then you can use tftp between them.
You can also use WIFI.
2.how to install tftp client?
If you have folloed the instruction in this blog then you have installed the tftp client,
where tftpd is server and tftp is client. Step 6 shows how to use tftp client
3.how to transfer the files between them?
Normally under all Linux OS due to security reason, You can get files from tftp server, but you can’t put.
So consider using ftp for file transfer between PC’s
All the best.
December 15, 2011 at 1:22 PM
hi all
i tried the instruction…..also the chmod but it gives me this..
sysadmin@sysadmin:/$ tftp 10.10.10.2
tftp> get test
tftp: test: Permission denied
tftp> exit
?Invalid command
tftp> quit
sysadmin@sysadmin:/$ sudo chmod -R 777 /tftpboot
sysadmin@sysadmin:/$ ls /tftpboot/test -lh
-rwxrwxrwx 1 sysadmin sysadmin 132 2011-12-15 08:46 /tftpboot/test
what’s wrong?
thank you very much
Marco
December 15, 2011 at 2:40 PM
The current directory where you are is not having write permission for your user. so change to some a directory where you have write permission eg. home path
$ cd ~/
Now test the tftp, it should work..
All the best.
December 15, 2011 at 3:00 PM
you right………after the post i found the solution…..’cause it worked with ” sudo tftp ”
thank you man….and sorry for time wasted
c ya
November 10, 2011 at 1:31 AM
I like this web site very much so much great information.
November 1, 2011 at 9:49 AM
Thank you for a wonderful info. it worked first time. Wish you can do the same for dhcp-server program. I have tried to follow the instructions but got failure installing it. Also dhcp3-server file was missing.
October 29, 2011 at 8:36 PM
Appreciate it for all your efforts that you have put in this. very interesting info . “Never trust the advice of a man in difficulties.” by Aesop.
September 10, 2011 at 11:54 AM
i am using “sudo apt-get install xinetd tftpd tftp” command nut i got
E: Unable to locate package xinetd
E: Unable to locate package tftpd
E: Unable to locate package tftp
I am using Ubuntu 11.04 Ver.
Y? can any one help me?
September 10, 2011 at 12:00 PM
I am also using Ubuntu 11.04. where I can find the package’s using this command.
$ apt-cache search xinetd
update-inetd – inetd configuration file updater
xinetd – replacement for inetd with many enhancements
globus-gfork-progs – Globus Toolkit – GFork Programs
rlinetd – gruesomely over-featured inetd replacement
Try
$ sudo apt-get update
then install it again.
July 26, 2011 at 6:59 PM
Great. Simple and very clear. Congratulations.
January 3, 2011 at 11:35 AM
[...] Installing and Testing TFTP Server in Ubuntu/Debian March 2010 4 comments 4 [...]
November 11, 2010 at 12:22 PM
Thanks
I have success follow instruction Installation
but I try put file from other computer to tftp server got “Access Violation”
how to set it for allowing upload file from outside tftpd server?
November 11, 2010 at 12:26 PM
I have missed some thing in the instruction use below step to solve the problem
$sudo chmod 777 -R /tftpboot/
Now it should work fine
November 11, 2010 at 12:47 PM
many thanks
Works fine now. Alhamdulillah
Assalamu’alaikum
November 11, 2010 at 12:28 PM
If you still have any problem, Then just post the log. I will try to figure it out.