6

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?

cnd
  • 1,893
  • 5
  • 18
  • 28
  • 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 06:09
  • Might want to add which tftp server you're using, and its configuration file. – Shadur Feb 16 '12 at 06:34
  • everything is qual this tutorial http://llbb.wordpress.com/2007/06/14/installing-tftp-on-fedora/ – cnd Feb 16 '12 at 06: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 09:26

3 Answers3

7

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.

vasquez
  • 596
  • 5
  • 8
2

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?

Victor Pudeyev
  • 412
  • 4
  • 6
-2

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

Vijay
  • 1
  • 2
    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 02 '15 at 15:12