Ask Your Question
1

basic setup of tftp to embeded linux running busybox

asked 2013-05-26 16:55:43 -0600

caseygolliher gravatar image

updated 2014-09-28 15:37:15 -0600

mether gravatar image

hi there,

i'm stumped by this and maybe you folks can help out I hope.

I have a lenovo x60 (with docking station). I'm running fedora 18

[localhost tftpboot]$ cat /etc/redhat-release Fedora release 18 (Spherical Cow) [@localhost tftpboot]$ uname -a Linux localhost.localdomain 3.9.3-201.fc18.x8664 #1 SMP Tue May 21 17:02:24 UTC 2013 x8664 x8664 x8664 GNU/Linux

I installed tftp by using yum install tftp / xinetd

I modified the tftp entry inxinetd,

    service tftp
{
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot
    disable         = no
    per_source      = 11
    cps         = 100 2
    flags           = IPv4
}

I try and use localhost to get a file called "HIYA" that's located in /tftpboot

      File: ‘/tftpboot/HIYA’
  Size: 5           Blocks: 8          IO Block: 4096   regular file
Device: 803h/2051d  Inode: 2228226     Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/cgadmin)   Gid: ( 1000/cgadmin)
Context: unconfined_u:object_r:default_t:s0
Access: 2013-05-26 12:43:42.328110592 -0700
Modify: 2013-05-26 12:43:36.416084600 -0700
Change: 2013-05-26 12:44:42.259356115 -0700
 Birth: -

it's just ascii txt, I echo "HIYA" into the file and chmod to 777 (not certain if this is needed but anyway)

I get

   @localhost tftpboot]$ tftp
(to) localhost
tftp> trace
Packet tracing on.
tftp> verbose
Verbose mode on.
tftp> get
(files) HIYA
getting from localhost:HIYA to HIYA [netascii]
sent RRQ <file=HIYA, mode=netascii>
sent RRQ <file=HIYA, mode=netascii>
sent RRQ <file=HIYA, mode=netascii>
sent RRQ <file=HIYA, mode=netascii>
sent RRQ <file=HIYA, mode=netascii>
Transfer timed out.

always. this has been a struggle for me for a while.

@localhost tftpboot]$ rpm -qa | grep tftp
tftp-server-5.2-6.fc18.x86_64
tftp-5.2-6.fc18.x86_64

tcpdump:

localhost tftpboot]$ sudo tcpdump -i p2p1 port 69 -vvv
tcpdump: listening on p2p1, link-type EN10MB (Ethernet), capture size 65535 bytes
14:50:06.775130 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 41)
    192.168.1.143.filenet-tms > 192.168.1.145.tftp: [udp sum ok]  13 RRQ "HIYA" octet
14:50:11.780282 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 41)
    192.168.1.143.filenet-tms > 192.168.1.145.tftp: [udp sum ok]  13 RRQ "HIYA" octet
14:50:16.777480 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 41)
    192.168.1.143.filenet-tms > 192.168.1.145.tftp: [udp sum ok]  13 RRQ "HIYA" octet
14:50:21.776658 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 41)
    192.168.1.143.filenet-tms > 192.168.1.145.tftp: [udp sum ok]  13 RRQ "HIYA" octet
14:50:26.776838 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 41)
    192.168.1.143.filenet-tms > 192.168.1.145.tftp: [udp sum ok]  13 RRQ "HIYA" octet

on the ... (more)

edit retag flag offensive close merge delete

Comments

looks like a selinux issue?

caseygolliher gravatar imagecaseygolliher ( 2013-05-26 17:08:49 -0600 )edit

The original /etc/xinetd.d/tftp uses /var/lib/tftpboot as the tftp root directory. By changing it arbitrarily, you caused the SELinux issue. Part of SELinux's job is to make sure that services only have access to directories that the policy allows them to.

randomuser gravatar imagerandomuser ( 2013-05-27 08:26:48 -0600 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2013-08-07 06:55:42 -0600

none gravatar image

restorecon -Rv /tftpboot should help.

edit flag offensive delete link more
0

answered 2013-05-26 17:01:16 -0600

caseygolliher gravatar image

updated 2013-05-26 17:02:12 -0600

I do this from the embedded linux machine to the linux host

~ # tftp -g -r HIYA 192.168.1.145

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-05-26 16:55:43 -0600

Seen: 8,266 times

Last updated: Aug 07 '13