Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started tftp-server, but I'm confused by this error:

nisemono ncdy # chmod 777 /tftproot/test 
mode of `/tftproot/test' changed to 0777 (rwxrwxrwx)
nisemono ncdy # tftp        
tftp> get test
Error code 0: Permission denied

0 bytes file is copied... But for what Permission denied??? I don't like the message.

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     = -s /tftproot
    per_source      = 11
    cps             = 100 2
    flags           = IPv4

Why is this failing? What am I doing wrong?

share|improve this question
Insufficient data for meaningful analysis. How are you invoking the tftp server? Show us the inetd or xinetd entry. Show us the mode bits of the /tftproot directory. – Kyle Jones Feb 16 '12 at 6:09
Might want to add which tftp server you're using, and its configuration file. – Shadur Feb 16 '12 at 6:34
everything is qual this tutorial llbb.wordpress.com/2007/06/14/installing-tftp-on-fedora – Cynede Feb 16 '12 at 6:42
tftpserver usually write some explain to the log files - try it search for the complain of tftp server by cd /var/log ; grep tftp *. In my opinion you will nedd to change permission only to 644. – Jan Marek Feb 16 '12 at 9:26
up vote 7 down vote accepted

Probably a selinux problem. Do a ls -alZ in the directory. On RHEL5/Centos5 the context should be user_u:object_r:tftpdir_t.

You can run restorecon -Rv /tftproot to fix it.

Edit: Just saw the fedora tag. It seems you're using not F16 but an earlier version, so the instructions above should work for you. With F16 the tftproot is in /var/lib and the context is system_u:object_r:tftpdir_rw_t:s0.

share|improve this answer
I'm using F16. but restorecon doesn't help me. (even when I switched to /var/lib/tftpboot) – Cynede Feb 16 '12 at 11:48
Seems like it fixed now ) not sure how exactly but in final I set 666 mod. – Cynede Feb 16 '12 at 12:01
You can test if this is the problem with setenforce 0 to switch selinux temporarily off. – vasquez Feb 16 '12 at 12:02

Did you try to save the file into a directory where you have no write permissions? Were you in /etc when you called tftp hostaddr?

share|improve this answer

That is the problem with setenforce. Type the command as setenforce 0 as SUDO. This resolves the issue.

share|improve this answer
Turning off selinux is never the right answer in the long term, you can use this to check whether selinux is stopping you from doing something as a quick test before turning it back on and fixing the selinux context. But turning off selinux is simply a dumb idea – Rumbles Jun 2 '15 at 15:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.