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.