2

I can't get tftp to work on my machine running Scientific Linux 6.1:

[root@bugs ~]# ls /tftpboot/
default  example.txt  MX075000.002_107  MX075100.002_025  MX076000.002  MX076200.002      MX0779900.002
[root@bugs ~]# tftp localhost
tftp> status
Connected to localhost.
Mode: netascii Verbose: off Tracing: off Literal: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> get example.txt
Transfer timed out.

This is the tftp configuration:

[claudiu@bugs claudiu]$ cat /etc/xinetd.d/tftp
service tftp
{
    disable = no
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -c -s /tftpboot -v -v -v
    per_source      = 11
    cps         = 100 2
    flags           = IPv4
}

xinetd is up and running:

[claudiu@bugs claudiu]$ sudo service xinetd status
xinetd (pid  23864) is running...

Tftp seems to be turned on and port 69 is open:

[claudiu@bugs claudiu]$ chkconfig | grep tftp
    tftp:           on
[claudiu@bugs claudiu]$ sudo nmap -sU localhost | grep 69
69/udp   open|filtered tftp

Also, the permissions seem to be set right:

[claudiu@bugs claudiu]$ ls -l / | grep ftp
drwxrwxrwx.   2 root    root     4096 Jan  5 15:48 tftpboot
[claudiu@bugs claudiu]$ cd /tftpboot/
[claudiu@bugs tftpboot]$ ls -l example.txt
-rwxrwxrwx. 1 root root 0 Jan  4 15:38 /tftpboot/example.txt

If anybody has any idea what could go wrong, I could use some help...

Claudiu
  • 645

3 Answers3

3

It seems that SELinux was causing the trouble. I didn't manage to make tftp work with it, so I fully disabled SELinux. I know it's not recommended, but if anybody else needs to know how to do this, here it is: you need to edit the /etc/selinux/config file and change the line containing "SELINUX=" to:

SELINUX=disabled

A system reboot is mandatory. Without it, the changes won't take effect.

Claudiu
  • 645
2

Check that ICMP is not prohibited in iptables. It solved my problems.

By the way, SELinux does not have to be disabled to make it work.

slhck
  • 235,242
mike
  • 21
1
echo 0 >/selinux/enforce

This will put SELinux in permissive mode, however a reboot will clear this.

cat /selinux/enforce

This would verify that it is in permissive mode.

This way you do not have to reboot the machine. Just make sure SELINUX=disabled in /etc/selinux/config so it survives a reboot.

slhck
  • 235,242