Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 192.168.0.2        
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
3  
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 –  Heather 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

3 Answers 3

up vote 5 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) –  Heather Feb 16 '12 at 11:48
    
Seems like it fixed now ) not sure how exactly but in final I set 666 mod. –  Heather 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

Your Answer

 
discard

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.