basic setup of tftp to embeded linux running busybox
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 ...
looks like a selinux issue?
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.