1. Install tftpd and related 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. Make /tftpboot directory
$ sudo mkdir /tftpboot $ sudo chmod -R 777 /tftpboot $ sudo chown -R nobody /tftpboot
4. Start tftpd through xinetd
$ sudo /etc/init.d/xinetd start
5. Testing. Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.100 (Server 192.168.1.100). Get an example file to transfer (eg. hda.txt)
$ touch /tftpboot/hda.txt $ chmod 777 /tftpboot/hda.txt $ ls -l /tftpboot/ total 0 -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt $ tftp 192.168.1.100 tftp> put hda.txt Sent 722 bytes in 0.0 seconds tftp> quit $ ls -l /tftpboot/ total 4 -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt
Works clean on fresh installation of Ubuntu 11.04 64-bit on Intel machine!
Thanks a lot. — Kosta
had mega problems with this.
finally tracked down to the problem the folder required
/var/lib/tftpboot and not just /tftpboot
why does the ‘/var/lib’ need to be specified
am using Ubuntu
cheers Brian
Pingback: Ubuntu: What I do after install « Binary Delusions
Pingback: Unix useful tips « Container
when you have issues with the daemon you can use:
/etc/init.d/xinetd stop
/etc/init.d/xinetd start
config of the file */etc/xinetd.d/tftp * should be:
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
}
I am on Ubuntu 10.04
Pingback: Ubuntu 11.10: What I do after Install « Binary Delusions
Thanks a lot! Seems to be OK on Ubuntu 11.10.
Hi, when i perform the
>get test
all i get is an empty test file in the directory, but i do have this
~$ cat /tftpboot/test
hello
any suggestions, i need to upload a new kernel to my arm device, and the only thing that’s giving me problems is the tftp server. Kinda sad 😛
I get
$ start xinetd
start: Rejected send message, 1 matched rules; type=”method_call”, sender=”:1.193″ (uid=1000 pid=4197 comm=”start xinetd “) interface=”com.ubuntu.Upstart0_6.Job” member=”Start” error name=”(unset)” requested_reply=”0″ destination=”com.ubuntu.Upstart” (uid=0 pid=1 comm=”/sbin/init”)
when I try to start the server (it also happens with “service xinetd start”). The server doesn’t start and when I try to get/put some file, I get “connection timeout”.
I’m trying to get this working using a directory in my Downloads folder using a different user name, and I’m not coming up with anything… Here’s what I’ve got so far…
tftp, and atftpd aren’t running, xinetd seems to be running fine.
root@Thunder-Dong:/home/bhowell# ps -ef | grep tftp
root 2572 2560 0 15:59 pts/1 00:00:00 grep tftp
root@Thunder-Dong:/home/bhowell# ps -ef | grep atftpd
root 2574 2560 0 16:00 pts/1 00:00:00 grep atftpd
root@Thunder-Dong:/home/bhowell# ps -ef | grep xinetd
root 1058 1 0 15:51 ? 00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6
root 2576 2560 0 16:00 pts/1 00:00:00 grep xinetd
root@Thunder-Dong:/home/bhowell# cat /etc/xinetd.d/tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = bhowell
server = /usr/sbin/in.tftpd
server_args = /home/bhowell/Downloads/TFTP
disable = no
}
root@Thunder-Dong:/home/bhowell# cat /etc/default/atftpd
USE_INETD=true
OPTIONS=”–tftpd-timeout 300 –retry-timeout 5 –mcast-port 1758 –mcast-addr 239.239.239.0-255 –mcast-ttl 1 –maxthread 100 –verbose=5 /home/bhowell/Downloads/TFTP”
root@Thunder-Dong:/home/bhowell/Downloads# ls -al | grep TFTP
drwxrwxr-x 2 bhowell bhowell 4096 2011-11-02 14:41 TFTP
root@Thunder-Dong:/home/bhowell/Downloads#
I found another site explaining how to set up atftpd, but the only thing it says to do is to set the INETD field to false. And to change the ownership of the file you’re copying from to nobody. Does the user field really matter?
Update….
I was able to put a file from the client (Cisco 3750) into the directory that I had created, now I having problems copying files from that directory into the switch.
I can put a file, but I can’t get it.
I received “Error code 2: Access violation”
I posted on http://ubuntuforums.org/showthread.php?t=1891866&highlight=access+code+violation
I got “transfer time out”
any idea???
Access violation error comes because you can put a file in /tftpboot with tftp client if that file is already exists with 777 permissions. I think this is a bullshit security regulation. I think most administrators uses tftp to save the configuration of the switches and routers. In this case iptables can create the proper security environment. But I am not a IT security man, just an administrator who have sucked a day with this Access violation.
To solve this problem I have downloaded the previous version (http://packages.ubuntu.com/hardy/i386/tftpd/download) of tftpd and copy the in.tftpd file from the .deb package to /usr/sbin/ on Ubuntu 10.04.
When you say: ‘ Create /etc/xinetd.d/tftp and put this entry:’ do you mean to edit the tftp file to include the text you posted ? The tftp fle on my system is ‘read only’…do I need to chmod and then vi the file to include the text posted ?
Pingback: how to use TFTP ( Trivial File Transfer Protocol )?
Is there any way to get a verbose logging of the tftp transactions? Example, IP address of user / host fetching a file from the tftp server?
Thanks,
Shastri
$ ftp localhost
ftp: connect: Connection refused
tftpd is a steaming pile of s***
Janos Molnar on January 25, 2012 at 12:27 am !
Yes! after seeking in a lot of pages, you were right. I couldn’t solve this
Destination filename [running-config]? ASA-runn
Cryptochecksum: 1d9d8f98 9d8883d7 3d0ca284 737eb3f0
!!!!!!!
%Error writing tftp://172.16.2.138/ASA-runn (Access violation)
but i installed the previous version and it works ok!!!
thanks!
This DOES NOT work in Ubuntu 12.04. Even installing older versions of tftpd does not fix it.
Pingback: Tftp installation | Charlestonslip
like brian on August 31, 2011 it worked only for me with
server_args = var/lib//tftpboot in /etc/inetd.d/tftp
and creating directory /var/lib/tftp
using Backtrack v5.2
Mr CG, this is TFTP, not FTP. Stop being stupid before stating things does not work.
Worked fine for me in 12.04. — though I did have issues when running as a vmware guest — fixed by switching to virtualbox 🙂
Make sure to put the file in there in /etc/xinetd.d/ as the package does not do it for you.
The new way to restart xinetd is ‘sudo service xinetd restart’
Pingback: Instalar un servidor tftp en Ubuntu 12.04 « MACTIZE.ES
xinetd is not used anymore after upgrading newer ubuntu 12.10 or linux mint14. now TFTP does not work anymore.
Pingback: Installing and setting TFTPD in Ubuntu | Embedded System
Pingback: Build and boot Linux (over network) | Prajosh Premdas
Pingback: Setup HTTPS SSL access on a Netgear GS724T switch | Snarly Sod Boxer's blog
Pingback: How do I create a file? - TecHub
Pingback: Installing and setting TFTPD in Ubuntu | Embedded System
Pingback: Ubuntu:How do I create a file? – Ubuntu Linux Questions